diff --git a/.github/workflows/processing.yml b/.github/workflows/processing.yml new file mode 100644 index 0000000..7c564b5 --- /dev/null +++ b/.github/workflows/processing.yml @@ -0,0 +1,79 @@ +name: Processing 4 + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + verify: + name: Java 17 / Processing 4.5.6 + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Java 17 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 + with: + distribution: temurin + java-version: "17.0.20+101" + cache: maven + + - name: Compile library; run parser tests; regenerate API documentation + run: mvn --batch-mode --no-transfer-progress clean verify javadoc:javadoc + + - name: Verify bundled library and documentation are current + run: | + cmp target/BVHParser.jar p5f_sample/code/BVHParser.jar + find target/reports/apidocs -type f \( -name '*.html' -o -name '*.css' -o -name '*.js' \ + -o -name 'ADDITIONAL_LICENSE_INFO' \) \ + -exec perl -pi -e 's/[ \t]+$//' {} + + diff --recursive --brief target/reports/apidocs p5f_sample/lib/doc + + - name: Restore Processing 4.5.6 cache + id: processing-cache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/processing-4.5.6 + key: processing-4.5.6-linux-x64-ddb816ca + + - name: Download Processing 4.5.6 + if: steps.processing-cache.outputs.cache-hit != 'true' + env: + PROCESSING_URL: https://github.com/processing/processing4/releases/download/processing-1434-4.5.6/processing-4.5.6-linux-x64-portable.zip + PROCESSING_SHA256: ddb816ca2c02e862a5dcf22b96bb4f81f412c4878673752b36837a7770970a6c + run: | + curl --fail --location --retry 3 --output "${RUNNER_TEMP}/processing.zip" "${PROCESSING_URL}" + echo "${PROCESSING_SHA256} ${RUNNER_TEMP}/processing.zip" | sha256sum --check + mkdir -p "${RUNNER_TEMP}/processing-4.5.6" + unzip -q "${RUNNER_TEMP}/processing.zip" -d "${RUNNER_TEMP}/processing-4.5.6" + + - name: Compile the PDE sketch with Processing 4.5.6 + run: | + PROCESSING_BIN=$(find "${RUNNER_TEMP}/processing-4.5.6" -type f \( -name processing -o -name Processing \) -print -quit) + test -n "${PROCESSING_BIN}" + chmod +x "${PROCESSING_BIN}" + "${PROCESSING_BIN}" cli \ + --sketch="${GITHUB_WORKSPACE}/p5f_sample" \ + --output="${RUNNER_TEMP}/p5f-sample-build" \ + --force \ + --build + + - name: Run a ten-frame P3D smoke test + run: | + set -o pipefail + PROCESSING_BIN=$(find "${RUNNER_TEMP}/processing-4.5.6" -type f \( -name processing -o -name Processing \) -print -quit) + timeout 30s xvfb-run --auto-servernum "${PROCESSING_BIN}" cli \ + --sketch="${GITHUB_WORKSPACE}/p5f_sample" \ + --output="${RUNNER_TEMP}/p5f-sample-run" \ + --force \ + --run \ + --smoke-test | tee "${RUNNER_TEMP}/p5f-sample-smoke.log" + grep -q "SMOKE_TEST_OK" "${RUNNER_TEMP}/p5f-sample-smoke.log" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b066599 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +target/ +.DS_Store +*.class diff --git a/README.md b/README.md new file mode 100644 index 0000000..074cfc5 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Perfume Global Site Project — Processing example + +[](https://github.com/perfume-dev/example-processing/actions/workflows/processing.yml) + +A Processing sketch that visualizes the three bundled BVH motion-capture files as animated point skeletons. This repository originated with the 2012 Perfume Global Site Project and is preserved as a small, runnable creative-coding example. + +## Compatibility + +- [Processing 4.5.6](https://processing.org/download/) (Java mode) +- macOS, Windows, or Linux with OpenGL support for the `P3D` renderer +- No separately installed Processing libraries + +The bundled `p5f_sample/code/BVHParser.jar` is built from the source in `p5f_sample/lib/src` against Processing Core 4.5.6 and Java 17. + +## Run the sketch + +1. Install Processing 4.5.6. +2. Open `p5f_sample/p5f_sample.pde` in Processing. +3. Press **Run**. + +The sketch loads `A_test.bvh`, `B_test.bvh`, and `C_test.bvh` from its `data` directory and plays all three motions in a continuously orbiting 3D view. + +## Development and verification + +The library and its parser tests require a Java 17 JDK and are checked against Processing Core 4.5.6: + +```sh +mvn -B clean verify +``` + +After changing the Java library source, rebuild the bundled Processing JAR and its API documentation: + +```sh +mvn -B package javadoc:javadoc +cp target/BVHParser.jar p5f_sample/code/BVHParser.jar +rm -rf p5f_sample/lib/doc +cp -R target/reports/apidocs p5f_sample/lib/doc +find p5f_sample/lib/doc -type f \( -name '*.html' -o -name '*.css' -o -name '*.js' \ + -o -name 'ADDITIONAL_LICENSE_INFO' \) \ + -exec perl -pi -e 's/[ \t]+$//' {} + +``` + +CI additionally compiles the complete PDE sketch with the official Processing 4.5.6 command-line tool and verifies that the committed JAR is identical to the reproducible Maven build. + +## Project stewardship and credits + +The [`perfume-dev` project](https://github.com/perfume-dev) and its repositories were established by [Daito Manabe](https://github.com/daitomanabe), who continues to maintain and administer them. [Perfume](https://www.perfume-web.jp/profile/) is a Japanese artist group; Manabe's documented collaborations with Perfume date to [2010](https://www.daito.ws/en/archive/perfume_12345678910/), and his credited roles across projects include [programming](https://www.bunka.go.jp/j-mediaarts-festival/award/single/perfume_global_site_project/index.html) as well as [creative direction, technical direction, and sound-effect design](https://www.daito.ws/archive/perfume-imaginary-museum-time-warp/). The 2012 project background and credits are documented by Japan's [Agency for Cultural Affairs](https://www.bunka.go.jp/j-mediaarts-festival/award/single/perfume_global_site_project/index.html) and in the [Daito Manabe archive](https://www.daito.ws/en/archive/perfume_globalsiteproject/). + +The repository history credits [Satoru Higa](https://github.com/satoruhiga) for the original 2012 import and Hiroyuki at Rhizomatiks for the subsequent parser and library work. Their original source and authorship history are retained. + +## License + +No license file was included in the original repository. Unless and until the maintainers add one, the source and bundled motion data remain subject to their respective owners' copyright; public availability does not by itself grant reuse rights. diff --git a/p5f_sample/PBvh.pde b/p5f_sample/PBvh.pde index f0d2605..8c913b3 100644 --- a/p5f_sample/PBvh.pde +++ b/p5f_sample/PBvh.pde @@ -1,38 +1,35 @@ -public class PBvh -{ - public BvhParser parser; +class PBvh { + final BvhParser parser; + + PBvh(String[] data) { + if (data == null) { + throw new IllegalArgumentException("BVH data could not be loaded"); + } - public PBvh(String[] data) - { parser = new BvhParser(); - parser.init(); - parser.parse( data ); + parser.parse(data); } - - public void update( int ms ) - { - parser.moveMsTo( ms );//30-sec loop + + void update(int ms) { + parser.moveMsTo(ms); parser.update(); } - - public void draw() - { - fill(color(255)); - - for( BvhBone b : parser.getBones()) - { + + void draw() { + fill(255); + + for (BvhBone bone : parser.getBones()) { pushMatrix(); - translate(b.absPos.x, b.absPos.y, b.absPos.z); + translate(bone.absPos.x, bone.absPos.y, bone.absPos.z); ellipse(0, 0, 2, 2); popMatrix(); - if (!b.hasChildren()) - { + + if (!bone.hasChildren()) { pushMatrix(); - translate( b.absEndPos.x, b.absEndPos.y, b.absEndPos.z); + translate(bone.absEndPos.x, bone.absEndPos.y, bone.absEndPos.z); ellipse(0, 0, 10, 10); popMatrix(); } - } } } diff --git a/p5f_sample/code/BVHParser.jar b/p5f_sample/code/BVHParser.jar index d9248d0..45d8488 100644 Binary files a/p5f_sample/code/BVHParser.jar and b/p5f_sample/code/BVHParser.jar differ diff --git a/p5f_sample/lib/doc/allclasses-frame.html b/p5f_sample/lib/doc/allclasses-frame.html deleted file mode 100644 index 7a6fac1..0000000 --- a/p5f_sample/lib/doc/allclasses-frame.html +++ /dev/null @@ -1,33 +0,0 @@ - - - -
- -| BvhBone
- -BvhParser - - |
-
| BvhBone
- -BvhParser - - |
-
-java.lang.Object --com.rhizomatiks.bvh.BvhBone -
public class BvhBone
-
+
| -tB[h̊Tv | -|
|---|---|
- processing.core.PVector |
-absEndPos
-
-- |
-
- processing.core.PVector |
-absPos
-
-- |
-
- processing.core.PMatrix3D |
-global_matrix
-
-- |
-
processing.core.PVectorprocessing.core.PVectorprocessing.core.PMatrix3D| -RXgN^̊Tv | -|
|---|---|
BvhBone()
-
-- |
-|
BvhBone(BvhBone __parent)
-
-- |
-|
| -\bh̊Tv | -|
|---|---|
- processing.core.PVector |
-getAbsEndPosition()
-
-- |
-
- processing.core.PVector |
-getAbsPosition()
-
-- |
-
- java.util.List<java.lang.String> |
-getChannels()
-
-- |
-
- java.util.List<BvhBone> |
-getChildren()
-
-- |
-
- float |
-getEndOffsetX()
-
-- |
-
- float |
-getEndOffsetY()
-
-- |
-
- float |
-getEndOffsetZ()
-
-- |
-
- java.lang.String |
-getName()
-
-- |
-
- int |
-getNbChannels()
-
-- |
-
- float |
-getOffsetX()
-
-- |
-
- float |
-getOffsetY()
-
-- |
-
- float |
-getOffsetZ()
-
-- |
-
- BvhBone |
-getParent()
-
-- |
-
- float |
-getXposition()
-
-- |
-
- float |
-getXrotation()
-
-- |
-
- float |
-getYposition()
-
-- |
-
- float |
-getYrotation()
-
-- |
-
- float |
-getZposition()
-
-- |
-
- float |
-getZrotation()
-
-- |
-
- java.lang.Boolean |
-hasChildren()
-
-- |
-
- java.lang.Boolean |
-isRoot()
-
-- |
-
- void |
-setAbsEndPosition(processing.core.PVector pos)
-
-- |
-
- void |
-setAbsPosition(processing.core.PVector pos)
-
-- |
-
- void |
-setChannels(java.util.List<java.lang.String> value)
-
-- |
-
- void |
-setChildren(java.util.List<BvhBone> value)
-
-- |
-
- void |
-setEndOffsetX(float value)
-
-- |
-
- void |
-setEndOffsetY(float value)
-
-- |
-
- void |
-setEndOffsetZ(float value)
-
-- |
-
- void |
-setName(java.lang.String value)
-
-- |
-
- void |
-setnbChannels(int value)
-
-- |
-
- void |
-setOffsetX(float value)
-
-- |
-
- void |
-setOffsetY(float value)
-
-- |
-
- void |
-setOffsetZ(float value)
-
-- |
-
- void |
-setParent(BvhBone value)
-
-- |
-
- void |
-setXposition(float value)
-
-- |
-
- void |
-setXrotation(float value)
-
-- |
-
- void |
-setYposition(float value)
-
-- |
-
- void |
-setYrotation(float value)
-
-- |
-
- void |
-setZposition(float value)
-
-- |
-
- void |
-setZrotation(float value)
-
-- |
-
- java.lang.String |
-structureToString()
-
-- |
-
- java.lang.String |
-structureToString(int __indent)
-
-- |
-
- java.lang.String |
-toString()
-
-- |
-
| NX java.lang.Object pꂽ\bh | -
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
-
- +
processing.core.PVectorprocessing.core.PVectorfloatfloatfloatgetName()intfloatfloatfloatfloatfloatfloatfloatfloatfloatisRoot()voidsetAbsEndPosition(processing.core.PVector pos) voidsetAbsPosition(processing.core.PVector pos) voidsetChannels(List<String> value) voidsetChildren(List<BvhBone> value) voidsetEndOffsetX(float value) voidsetEndOffsetY(float value) voidsetEndOffsetZ(float value) voidvoidsetnbChannels(int value) voidsetOffsetX(float value) voidsetOffsetY(float value) voidsetOffsetZ(float value) voidvoidsetXposition(float value) voidsetXrotation(float value) voidsetYposition(float value) voidsetYrotation(float value) voidsetZposition(float value) voidsetZrotation(float value) structureToString(int __indent) toString()-public processing.core.PVector absPos-
-public processing.core.PVector absEndPos-
-public processing.core.PMatrix3D global_matrix-
| -RXgN^̏ڍ | -
|---|
-public BvhBone(BvhBone __parent)-
-public BvhBone()-
| -\bh̏ڍ | -
|---|
-public java.lang.String toString()-
java.lang.Object toString-public java.lang.String structureToString()-
-public java.lang.String structureToString(int __indent)-
-public java.lang.String getName()-
-public void setName(java.lang.String value)-
-public java.lang.Boolean isRoot()-
-public java.lang.Boolean hasChildren()-
-public java.util.List<BvhBone> getChildren()-
-public void setChildren(java.util.List<BvhBone> value)-
-public BvhBone getParent()-
-public void setParent(BvhBone value)-
-public java.util.List<java.lang.String> getChannels()-
-public void setChannels(java.util.List<java.lang.String> value)-
-public int getNbChannels()-
-public void setnbChannels(int value)-
-public float getZrotation()-
-public void setZrotation(float value)-
-public float getYrotation()-
-public void setYrotation(float value)-
-public float getXrotation()-
-public void setXrotation(float value)-
-public float getZposition()-
-public void setZposition(float value)-
-public float getYposition()-
-public void setYposition(float value)-
-public float getXposition()-
-public void setXposition(float value)-
-public float getEndOffsetZ()-
-public void setEndOffsetZ(float value)-
-public float getEndOffsetY()-
-public void setEndOffsetY(float value)-
-public float getEndOffsetX()-
-public void setEndOffsetX(float value)-
-public float getOffsetZ()-
-public void setOffsetZ(float value)-
-public float getOffsetY()-
-public void setOffsetY(float value)-
-public float getOffsetX()-
-public void setOffsetX(float value)-
-public void setAbsPosition(processing.core.PVector pos)-
-public processing.core.PVector getAbsPosition()-
-public void setAbsEndPosition(processing.core.PVector pos)-
-public processing.core.PVector getAbsEndPosition()-
-
-
|
-- - | -||||||||
| - ÕNX - ̃NX | -- t[ - t[Ȃ - - - - - | -||||||||
| - Tv: q | tB[h | RXgN^ | \bh | --ڍ: tB[h | RXgN^ | \bh | -||||||||
-java.lang.Object --com.rhizomatiks.bvh.BvhParser -
public class BvhParser
-
- +
| -RXgN^̊Tv | -|
|---|---|
BvhParser()
-
-- |
-|
| -\bh̊Tv | -|
|---|---|
- java.util.List<BvhBone> |
-getBones()
-
-- get bones list |
-
- java.lang.Boolean |
-getMotionLoop()
-
-- if set to True motion will loop at end |
-
- int |
-getNbFrames()
-
-- get frame total |
-
- void |
-init()
-
-- call before parse BVH + Method Summary+
+
+
+
+ Modifier and Type
+Method
+Description
+
+getBones()
+
+get bones list
+int
+
+get the currently selected frame
+float
+
+
+
+get the duration of one frame in seconds
+
+
+if set to True motion will loop at end
+int
+
+get frame total
+voidinit()
+ call before parse BVH
create array instance
- and setloopstatus true |
-
- void |
-moveFrameTo(int __index)
-
-- go to the frame at index |
-
- void |
-moveMsTo(int mills)
-
-- go to millisecond of the BVH |
-
- void |
-parse(java.lang.String[] srces)
-
-- |
-
- void |
-setMotionLoop(java.lang.Boolean value)
-
-- set Loop state |
-
- java.lang.String |
-toStr()
-
-- to string |
-
- void |
-update()
-
-- update bone position and rotation |
-
| NX java.lang.Object pꂽ\bh | -
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
- + and setloopstatus true
voidmoveFrameTo(int __index) voidmoveMsTo(int mills) voidvoidsetMotionLoop(boolean value) voidsetMotionLoop(Boolean value) toStr()voidupdate()protected voidclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait| -RXgN^̏ڍ | -
|---|
-public BvhParser()-
| -\bh̏ڍ | -
|---|
-public java.lang.Boolean getMotionLoop()-
-
-public void setMotionLoop(java.lang.Boolean value)-
-
value - -public java.lang.String toStr()-
-
-public int getNbFrames()-
-
-public java.util.List<BvhBone> getBones()-
-
-public void init()-
value - value - -
-public void moveFrameTo(int __index)-
-
-public void moveMsTo(int mills)-
-
mills - millisecondloopSec - the default loopsec for-public void update()-
-
-public void parse(java.lang.String[] srces)-
mills - millisecond
-
-
|
-- - | -||||||||
| - ÕNX - ̃NX | -- t[ - t[Ȃ - - - - - | -||||||||
| - Tv: q | tB[h | RXgN^ | \bh | --ڍ: tB[h | RXgN^ | \bh | -||||||||
getBones()getChildren()voidprotected void|
-NX
-
- -BvhBone - -BvhParser |
-
-
-
|
-- - | -||||||||
| - O - | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O - | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O - | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O - | -- t[ - t[Ȃ - - - - - | -||||||||
You can search for definitions of modules, packages, types, fields, methods, system properties and other terms defined in the API, using some or all of the name, optionally using "camelCase" abbreviations. For example:
+j.l.obj will match "java.lang.Object"InpStr will match "java.io.InputStream"HM.cK will match "java.util.HashMap.containsKey(Object)"Refer to the Javadoc Search Specification for a full description of search features.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.
+Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.
+The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Packages and modules may contain pages with additional information related to the declarations nearby.
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the USE link in the navigation bar.
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.
The All Packages page contains an alphabetic index of all packages contained in the documentation.
+The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.
+The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.
+
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||
-
-
|
-- - | -||||||||
| - O̕ - ̕ | -- t[ - t[Ȃ - - - - - | -||||||||