[x3d-public] X3D 4.0 specification problem: TextureProjectorparallel.fieldOfView
John Carlson
yottzumm at gmail.com
Fri Jul 25 03:46:51 PDT 2025
" X3DJSAIL is OK."
I would state that X3DJSAIL needs to be rechecked based on recent
evidence. It does not take 4 parameters, as X3dToJava.xslt produces
(assuming my X3dToJava.xslt is up to date) 4 separate parameters to
OrthoViewpoint.fieldOfView, as of 2 days ago (the stylesheet hasn't changed
on sourceforge as of today).
~/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/jsail/Navigation
$ grep public.*setFieldOfView 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)
All setFieldOfView methods take a single parameter, yes, an array with 4
values, but I don't know if they are restricted to four. Let me check
JSON schema..no maxItems or minItems properties for fieldOfView in JSON
Schema. Maybe something is missing in X3DUOM.
<field name="fieldOfView"
type="MFFloat"
accessType="inputOutput"
default="-1 -1 1 1"
description="Minimum and maximum extents of view in
units of local coordinate system."/>
An SFVec4f would be better for restricting the number of values in the
MFFloat.
That would be OK by me, but there's no fieldOfView field in the
corresponding JSON or XML output from X3DJSAIL!
May I suggest making a comprehensive example of all nodes, attributes and
fields in a single Java program?
This is probably a subject still under discussion. I just want my data
back from the array I passed in:
setFieldOfView(new MFFloat3().getArray()))
private class MFFloat3 {
private org.web3d.x3d.jsail.fields.MFFloat getArray() {
return new org.web3d.x3d.jsail.fields.MFFloat(new double[]
{0f,0f,10f,10f});
}
}
Here's the line of Java code generated by X3dToJava.xslt. Note, 4 separate
parameters.
$ grep setFieldOfView *.java
Connectors.java: .addChild(new
OrthoViewpoint().setDescription("OthoViewpoint").setCenterOfRotation(-3.13496,-4.19776,0.0).setFieldOfView(0.0,0.0,10.0,10.0).setPosition(-3.13496,-4.19776,10.0))
[snip, others with Viewpoint have a single float/double parameter. I am
referring to OrthoViewpoint]
Try the raw version of Connectors.x3d in X_ITE Playground after removing
OrthoViewpoint.fieldOfView to see what happens:
https://create3000.github.io/x_ite/playground/?url=https://raw.githubusercontent.com/create3000/Library/refs/heads/main/Tests/Components/Shape/Connectors.x3d
That's what I'm getting in Sunrize. A blank screen. Luckily, I had some
diffs generated from the original .x3d so tracking down difficulties became
easy!
I encourage you to check out Holger's Library examples for testing!
==============================================================================
my X3DUOM has one change after yours:
PS C:\Users\jcarl\www.web3d.org\specifications> svn-diff
Index: C:/Users/jcarl/
www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml
===================================================================
--- C:/Users/jcarl/
www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml (revision
37269)
+++ C:/Users/jcarl/
www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml (working copy)
@@ -21322,7 +21322,6 @@
type="SFVec3f"
accessType="inputOutput"
default="1 1 1"
- minExclusive="0"
description="Non-uniform x-y-z scale of child
coordinate system, adjusted by center and scaleOrientation."/>
<field name="scaleOrientation"
type="SFRotation"
This is to avoid scale -1 complaints in HAnimHumanoid, but I think I fixed
the data, so I will restore your version, recalling that I need to restore
Holger's X_ITE changes to the X3DUOM to JSON schema (eventually)
Thanks,
John
On Sat, Dec 28, 2024 at 11:07 PM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:
> 4. "OrthoViewpoint.setFieldOfView has 4 parameters, probably should be one
> parameter, or X3DJSAIL should provide a 4 parameter option."
>
> OrthoViewpoint fieldOfView is only zero or four floats. Anything else
> does not define the 4 corners of an orthographic field of view. X3DJSAIL
> is OK.
>
> This has been the basis of the long-running issue: do we leave it with
> type MFFloat, or do we make it type SFVec4f (similar to ClipPlane.plane and
> TextureProjectorParallel.fieldOfView) so that incorrect array lengths are
> detected during validation.
>
> Related:
>
> - X3D Tooltips 4.0, OrthoViewpoint.fieldOfView
> -
> https://www.web3d.org/x3d/tooltips/X3dTooltips.html#OrthoViewpoint.fieldOfView
> - *Warning: *if provided, OrthoViewpoint fieldOfView has exactly four
> numeric values, otherwise results are undefined.
> - *Warning:* OrthoViewpoint fieldOfView has type MFFloat even though
> SFVec3f is more correct to prevent modeling errors, deficiency recorded as
> Mantis 1398
>
> - Mantis 1398: OrthoViewpoint fieldOfView type needs to be SFVec4f,
> not MFFloat
> - https://mantis.web3d.org/view.php?id=1398
>
> - X3D Architecture 4.1 (draft), 42.4.2 TextureProjectorParallel
> -
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/navigation.html#OrthoViewpoint
> - The *fieldOfView* field for this parallel projection specifies
> minimum and maximum extents of the view in units of the local coordinate
> system. A small field of view roughly corresponds to a telephoto lens; a
> large field of view roughly corresponds to a wide-angle lens. If
> provided, the *fieldOfView* field has exactly four numeric values,
> otherwise results are undefined.
> - X3DJSAIL OrthoViewpoint setFieldOfView has multiple methods for
> floats, doubles (which are downcast to floats) and integers (which are
> promoted to floats). The preceding warning will appear in the Javadoc
> following the next release build.
> -
> https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/OrthoViewpoint.html#setFieldOfView(float[])
>
> I hope that this answer is satisfactory.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250725/068e4a09/attachment.html>
More information about the x3d-public
mailing list