[x3d-public] announce: X3D Java Scene Authoring Interface (SAI)open source, beta supports colors and field names for ROUTEs

yottzumm at gmail.com yottzumm at gmail.com
Sat Nov 5 16:29:00 PDT 2016


Errors from recently checked out sources:

    [javac] C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\org\web3d\x3d\java\CADGeometry\CADAssemblyObject.java:394: error: cannot find symbol
    [javac]             DEF = DEFname;
    [javac]             ^
    [javac]   symbol:   variable DEF
    [javac]   location: class CADAssemblyObject
    [javac] C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\org\web3d\x3d\java\CADGeometry\CADAssemblyObject.java:417: error: cannot find symbol
    [javac]             if (USE.length() > 0)
    [javac]                 ^
    [javac]   symbol:   variable USE
    [javac]   location: class CADAssemblyObject
    [javac] C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\org\web3d\x3d\java\fields\CommentsBlock.java:218: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\org\web3d\x3d\java\fields\CommentsBlock.java:225: error: method does not override or implement a method from a supertype



When run from:


~/apache-ant-1.9.7/apache-ant-1.9.7/bin/ant CreateX3dSceneAccessInterfaceJava


John
Sent from Mail for Windows 10

From: Don Brutzman
Sent: Friday, November 4, 2016 3:06 PM
To: X3D Graphics public mailing list
Subject: Re: [x3d-public] announce: X3D Java Scene Authoring Interface (SAI)open source, beta supports colors and field names for ROUTEs

Two nice programming features have emerged during beta-test development.

	X3D Java Scene Access Interface (SAI) Library
	http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html

1.  /Complete/. Added support for numerous hexadecimal 0xRRGGBB integer colors (through defined constants and utility methods) to SFColorObject and related classes.

Reference:
CSS Color Module Level 3, 4.3. Extended color keywords
https://www.w3.org/TR/css3-color/#svg-color

147 Web colors provided as Java SFColor RGB values:
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/fields/SFColorObject.html
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/fields/SFColorObject.html#ALICEBLUE

Example source showing use:

boxMaterial.setDiffuseColor(MaterialObject.DIFFUSECOLOR_DEFAULT_VALUE);
boxMaterial.setDiffuseColor(new float[] {0, 1, 1});                                // equivalent
boxMaterial.setDiffuseColor((new SFColorObject(0.0f, 1.0f, 1.0f)).toFloatArray()); // equivalent
boxMaterial.setDiffuseColor((new SFColorObject(0x00FFFF)).toFloatArray());         // equivalent
boxMaterial.setDiffuseColor(SFColorObject.CYAN);                                   // equivalent


2. /Complete/. Add string constants naming each field eligible for ROUTE connections,
e.g. OrientationInterpolatorObject.toField_SET_FRACTION and
       OrientationInterpolatorObject.fromField_VALUE_CHANGED.

Example source showing use:
		
ROUTEObject  spinROUTE = new ROUTEObject();
spinROUTE.setFromNode(clockDEF).setFromField("fraction_changed")
		 .setToNode(orientationInterpolatorDEF).setToField("set_fraction");	// equivalent, typos possible

spinROUTE.setFromNode(clockDEF)
		 .setFromField(TimeSensorObject.fromField_FRACTION_CHANGED)
		 .setToNode(orientationInterpolatorDEF)
		 .setToField(OrientationInterpolatorObject.toField_SET_FRACTION);	// equivalent, correctly named

http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Interpolation/OrientationInterpolatorObject.html#toField_SET_FRACTION
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Interpolation/OrientationInterpolatorObject.html#fromField_VALUE_CHANGED

As with other Java constructs, these field names get automatically generated into the Java SAI Library by using information found the X3D Object Model.  So these string constants are always correct and always available to the programmer.  It is always valuable to try pushing error detection from end-user run time (ouch) to programmer compile time (aha, a bug to fix).  These good programming practices add up, and all help X3D Quality Assurance (QA).


3. Test program and library are getting daily improvements.  Source and resultant demo scene online at

http://www.web3d.org/specifications/java/examples/
http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java
http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d

inversion control
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples

Have fun with X3D Java!

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20161105/40e9d866/attachment.html>


More information about the x3d-public mailing list