[x3d-public] announce: update releases for X3D Schematron and the X3DJSAIL Java library
John Carlson
yottzumm at gmail.com
Tue Jul 29 16:24:15 PDT 2025
Okay, seeing this fix, it looks good, I will test now
if ((((getFieldOfView().length > 0) &&
!getFieldOfViewList().equals(FIELDOFVIEW_DEFAULT_VALUE)) ||
!ConfigurationProperties.getStripDefaultAttributes()) /* ArrayList .x3d
compare */ && !hasUSE())
{
stringX3D.append("
fieldOfView='").append(MFFloat.toString(getFieldOfView())).append("'");
}
On Tue, Jul 29, 2025 at 6:20 PM John Carlson <yottzumm at gmail.com> wrote:
> Okay, I'm not sure if there are updates, but here's my take:
>
> In OrthoViewpoint.java,
>
> This code (XML output) looks like this:
>
> if ((((getFieldOfView().length > 0)
> ).equals(FIELDOFVIEW_DEFAULT_VALUE)) ||
> !ConfigurationProperties.getStripDefaultAttributes()) /* ArrayList .x3d
> compare */ && !hasUSE())
> {
> stringX3D.append("
> fieldOfView='").append(MFFloat.toString(getFieldOfView())).append("'");
> }
>
> The condition for VRML output looks better, but I haven't tested it.
>
> if (((getFieldOfView().length > 0) &&
> !getFieldOfViewList().equals(FIELDOFVIEW_DEFAULT_VALUE)) ||
> !ConfigurationProperties.getStripDefaultAttributes()) /* ArrayList .x3dv
> compare */
> {
>
> stringClassicVRML.append("fieldOfView ").append("[
> ").append(MFFloat.toString(getFieldOfView())).append("
> ]").append("\n").append(indent).append(indentCharacter);
> }
>
> There's an ant target for just rebuilding one file, and building Jars, so
> I can just modify OrthoViewpiont.java, that would be useful information:
>
>
> I am not prepared to debug XSLT. But I see the comment you put there, so
> I will go hunting.
>
> I'm certainly hoping you will quickly upstream my code if I find a fix.
>
> John
>
> On Mon, Jul 28, 2025 at 11:19 PM Don Brutzman <don.brutzman at gmail.com>
> wrote:
>
>> Thanks for the trouble report. Please include .x3d file in such reports
>> so that repeatability is possible.
>>
>> - Ticket #42 Missing OrthoViewpoint.fieldOfView when using MFFloat
>> - https://sourceforge.net/p/x3d/tickets/42/
>>
>> Of relevant note is presence of following HelloWorldProgram.java "smoke
>> test" program, which demonstrates successful operation. I just adjusted it
>> to include the OrthoViewpoint tests in all of the various output files.
>> Still having some trouble getting fieldOfView output (not sure why) and a
>> properly valid pattern for Layout publication.
>>
>> - HelloWorldProgram.java
>> -
>> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgram.java#l201
>>
>> my updated excerpt:
>>
>>> // testing layout.setAlign()
>>> Layout layout = new Layout("SpecialTestLayout");
>>> layout.setAlign("LEFT");
>>> layout.setAlign(Layout.ALIGN_LEFT_BOTTOM);
>>> layout.setAlign(new java.lang.String[] {"LEFT","BOTTOM"});
>>> // layout.setAlign(Layout.ALIGN_LEFT); // TODO test singleton
>>> enumerations
>>> System.out.println("layout.getAlign=" + layout.getAlignString());
>>> System.out.println("layout field smoke tests = " +
>>> Boolean.toString((new
>>> MFString(layout.getAlign())).toString().equals((new
>>> MFString(Layout.ALIGN_LEFT_BOTTOM)).toString())) +
>>> " (through manual debug checks)");
>>> LayoutGroup layoutGroup = new
>>> LayoutGroup("SpecialTestLayoutGroup")
>>> .setLayout(layout);
>>> layoutGroup.addChild(layout);
>>> // scene.addChild(layoutGroup); // TODO how best to add to scene?
>>> validation problems need to be sorted out...
>>>
>>> // testing orthoViewpoint.setFieldOfView()
>>> OrthoViewpoint orthoViewpoint = new
>>> OrthoViewpoint("SpecialTestOrthoViewpoint");
>>> orthoViewpoint.setFieldOfView(1, 2, 3, 4);
>>> // valid, special-case utility method
>>> orthoViewpoint.setFieldOfView(new SFVec4f(1, 2, 3, 4));
>>> // valid, special-case utility method
>>> orthoViewpoint.setFieldOfView(new float[] {1, 2, 3, 4});
>>> // valid
>>> orthoViewpoint.setFieldOfView(new MFFloat(new float[] {1, 2, 3,
>>> 4})); // valid
>>> System.out.println("Multiple tests pass for
>>> orthoViewpoint.fieldOfView=" + orthoViewpoint.getFieldOfViewString() + "="
>>> + Arrays.toString(orthoViewpoint.getFieldOfView()) +
>>> " for (minimum_x, minimum_y, maximum_x,
>>> maximum_y)");
>>> System.out.println("Test improper invocation
>>> orthoViewpoint.setFieldOfView(4, 3, 2, 1);");
>>> orthoViewpoint.setFieldOfView(4, 3, 2, 1); // erroneous
>>>
>>> scene.addChild(orthoViewpoint); // TODO why isn't fieldOfView
>>> appearing in output?
>>
>>
>> As the head of the prior log file shows, the Ant tests are in the parent
>> stylesheets directory, target *test.X3DJSAIL* and
>> *test.X3DJSAIL.Schematron*
>>
>> -
>> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/build.xml#l421
>>
>> -
>> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/build.xml#l2209
>>
>> Posted another X3DJSAIL update. Good luck on next steps.
>>
>> all the best, Don
>>
>> On Mon, Jul 28, 2025 at 1:35 AM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Here's the Java presented from X3DJSAIL:
>>>
>>> $ java -cp ".;../../../X3DJSAIL.4.0.full.jar"
>>> org.web3d.x3d.jsail.CommandLine -toJava Connectors.x3d|grep ieldOf
>>> no className provided, using normalized meta title value='Connectors'
>>> .addChild(new
>>> OrthoViewpoint().setDescription("OthoViewpoint").setCenterOfRotation(-3.13496,-4.19776,0.0).setFieldOfView(new
>>> double[] {0.0,0.0,10.0,10.0}).setPosition(-3.13496,-4.19776,10.0))
>>>
>>> That's OK. Apparently the stylesheet version doesn't work, so I will be
>>> switching away from exclusively using stylesheets. I can't seem to
>>> preserve the intermediate XML from X3DJSAIL. I suggest this issue is from
>>> not exporting fieldOfView to the intermediate file. This was the
>>> second half of the original report.
>>>
>>> $ grep public.*set.ieldOfView OrthoViewpoint.java
>>> public OrthoViewpoint setFieldOfView(float[] newValue)
>>> public OrthoViewpoint setFieldOfView(MFFloat newValue)
>>> public OrthoViewpoint setFieldOfView(ArrayList<Float> newValue)
>>> public OrthoViewpoint setFieldOfView(int[] newValue)
>>> public OrthoViewpoint setFieldOfView(double[] newArray)
>>> public OrthoViewpoint setFieldOfView(SFVec4f newFieldOfView)
>>> public OrthoViewpoint setFieldOfView(float minimum_x, float
>>> minimum_y, float maximum_x, float maximum_y)
>>>
>>> $ javac -cp ".;../../../X3DJSAIL.4.0.full.jar"
>>> net/x3djsonld/data/Connectors.java
>>>
>>> $ java -cp ".;../../../X3DJSAIL.4.0.full.jar"
>>> net.x3djsonld.data.Connectors
>>> Build this X3D model, showing validation diagnostics...
>>> Connectors self-validation test confirmation: success
>>> Note: toFileX3D() is overwriting prior file ./Connectors_JavaExport.x3d
>>> Note: toFileClassicVRML() is overwriting prior file
>>> ./Connectors_JavaExport.x3dv
>>>
>>> $ ls -ltr Connectors_JavaExport.x3d* net/x3djsonld/data/Connectors.*
>>> -rw-r--r-- 1 jcarl 197609 26294 Jul 28 03:23
>>> net/x3djsonld/data/Connectors.java
>>> -rw-r--r-- 1 jcarl 197609 19013 Jul 28 03:27
>>> net/x3djsonld/data/Connectors.class
>>> -rw-r--r-- 1 jcarl 197609 14301 Jul 28 03:27 Connectors_JavaExport.x3d
>>> -rw-r--r-- 1 jcarl 197609 10417 Jul 28 03:27 Connectors_JavaExport.x3dv
>>>
>>> $ grep -i fieldOfView Connectors_JavaExport.x3d*
>>> net/x3djsonld/data/Connectors.java
>>> net/x3djsonld/data/Connectors.java: .addChild(new
>>> OrthoViewpoint().setDescription("OthoViewpoint").setCenterOfRotation(-3.13496,-4.19776,0.0).setFieldOfView(new
>>> double[] {0.0,0.0,10.0,10.0}).setPosition(-3.13496,-4.19776,10.0))
>>>
>>> So the MFFloat for setFieldOfValue is not appearing in XML or Classic
>>> VRML output, I'm guessing it's not in the intermediate XML.
>>>
>>> I have not tried setting the flag for not deleting the intermediate file
>>> yet. I have more important things to accomplish.
>>>
>>> I will be posting this message on sourceforge. Java is attached if you
>>> want to play with it.
>>>
>>> Good luck!
>>>
>>> John
>>> On Sun, Jul 27, 2025 at 1:36 PM Don Brutzman via x3d-public <
>>> x3d-public at web3d.org> wrote:
>>>
>>>>
>>>>
>>>> - *Complete*. Added utility methods setFieldOfView(SFVec4f newValue)
>>>> <https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/OrthoViewpoint.html#setFieldOfView(org.web3d.x3d.jsail.fields.SFVec4f)>
>>>> and setFieldOfView(float minimum_x, float minimum_y, float
>>>> maximum_x, float maximum_y)
>>>> <https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/OrthoViewpoint.html#setFieldOfView(float,float,float,float)>.
>>>> Nevertheless, multiple counterintuitive *MFFloat* accessor methods
>>>> also appear... Probably need to change *fieldOfView* field to type
>>>> *SFVec4f*, for programmer clarity when handling the *fieldOfView* field,
>>>> as recommended by Mantis 1398
>>>> <https://mantis.web3d.org/view.php?id=1398>.
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250729/806c96ed/attachment-0001.html>
More information about the x3d-public
mailing list