[x3d-public] SFRotation constructor axis argument by referenceorvalue ?

Joseph D Williams joedwil at earthlink.net
Sat Mar 7 09:36:49 PST 2020




➢ Since a Viewpoint is an independent object, am expecting that it would retain its own persistent values and not change if a separate object (previously used as a setter) were to change.

Right, until the next time the complete SFRotation is applied to the node. 
In fact, I think it is not possible to change an node field like axis in this example by just changing one value of the x y z. I seem to remember you can’t apply (by route or by script) parts of an MF, you have to send the entire array. In a script you can set .x .y .z but can’t route or directOut anything but the complete MF. 


➢ expected therefore to copy the axis x,y,z over

I would expect that if x y or z of axis was changed, it would not produce any effect until the complete rotation axis, angle was applied. I don’t think we ought to expect to be able to route or directout rot,x, for example until the script completes and the new complete rot x y z a is sent and applied.  
Joe

From: Don Brutzman
Sent: Friday, March 6, 2020 8:00 AM
To: GPU Group; Andreas Plesch
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] SFRotation constructor axis argument by referenceorvalue ?

Since a Viewpoint is an independent object, am expecting that it would retain its own persistent values and not change if a separate object (previously used as a setter) were to change.

The specifications always try to be as precise, unambiguous and succinct as possible.

If there are improvements to functional definitions or descriptive prose that might be made, people are always welcome to make them.

The X3D Working Group (thanks to Web3D Consortium) then tracks issues, helps everyone work to consensus, edits the specifications and submits for Web3D/ISO approval.

On 3/6/2020 6:12 AM, GPU Group wrote:
> The 'last one set' rule sounds interesting for Viewpoint {
> SFRotation orientation
> SFVec3f direction
> SFVec3f upVector
> ...
> }
> would allow both ways of setting orientation
> 
> On Fri, Mar 6, 2020 at 6:43 AM Andreas Plesch <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>> wrote:
> 
>     I looked at the abstract and Java SAI spec. but they do not have more guidance.
> 
>     In my mind, the argument for the axis vector in the constructor to become decoupled from the rotation, eg. rot.y = 0 in the example, was that SFRotation is only defined in terms of float primitives, x,y,z and a. The constructor using axis is expected therefore to copy the axis x,y,z over and the axis vector would not be kept with the rotation (except perhaps internally for convenience).
> 
>     Of course, this is quite a lot to deduce from a few lines in the spec.
> 
>     my 2c,
> 
>     Andreas
> 
>     ---on the phone---
> 
>     On Thu, Mar 5, 2020, 4:04 PM Joseph D Williams <joedwil at earthlink.net <mailto:joedwil at earthlink.net>> wrote:
> 
>           * So I would guess for ecmascript it should____
> 
>         be rot.y = 1.0
> 
>         __ __
> 
>         me too because rot values can be set as rot.x rot.y rot.z and rot.a
> 
>         and axis can be set by by axis.x  axis.y and axis.z
> 
>         so in this example the last one set is the final value.
> 
>         Joe
> 
>         __ __
> 
>         *From: *Andreas Plesch <mailto:andreasplesch at gmail.com>
>         *Sent: *Tuesday, March 3, 2020 7:08 AM
>         *To: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
>         *Subject: *[x3d-public] SFRotation constructor axis argument by reference orvalue ?
> 
>         __ __
> 
>         In the ecmascript SAI, SFRotation has a constructor which has the
> 
>         rotation axis as a SFVec3f argument:
> 
>         __ __
> 
>         new SFRotation ( SFVec3f axis, numeric  angle )
> 
>         __ __
> 
>         https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation
> 
>         (Table 7.18, -url in the first sentence is off-)
> 
>         __ __
> 
>         The question is when I make a new SFRotation and later change the
> 
>         SFVec3f which was used for the axis, does the previously constructed
> 
>         SFRotation also change ?
> 
>         __ __
> 
>         axis = new SFVec3f ( 0, 0, 1 );
> 
>         rot = new SFRotation( axis, 3.14 );
> 
>         axis.y = 1.0
> 
>         axis.z = 0.0
> 
>         // rot.y is ?
> 
>         // constructed by value: rot.y = 0.0
> 
>         // constructed by reference: rot.y = 1.0
> 
>         __ __
> 
>         I did not check the abstract SAI spec. for guidance so it is very
> 
>         possible I missed something.
> 
>         __ __
> 
>         This is just an example. There are of course other constructors which
> 
>         use objects as parameters. It is also probably rare that a script
> 
>         would want to do this.
> 
>         __ __
> 
>         It may depend on the scripting language. In ecmascript objects are
> 
>         passed by reference, you have to explicitly make a copy if you need
> 
>         it. This is for performance. So I would guess for ecmascript it should
> 
>         be rot.y = 1.0 .
> 
>         __ __
> 
>         -Andreas
> 
>         __ __
> 
>         __ __
> 
>         -- 
> 
>         Andreas Plesch
> 
>         Waltham, MA 02453
> 
>         __ __
> 
>         _______________________________________________
> 
>         x3d-public mailing list
> 
>         x3d-public at web3d.org <mailto:x3d-public at web3d.org>
> 
>         http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 
>         __ __
> 
>     _______________________________________________
>     x3d-public mailing list
>     x3d-public at web3d.org <mailto:x3d-public at web3d.org>
>     http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 
> 
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 

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

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200307/fcd14313/attachment-0001.html>


More information about the x3d-public mailing list