<div dir="ltr">The 'last one set' rule sounds interesting for Viewpoint {<div>SFRotation orientation</div><div>SFVec3f direction</div><div>SFVec3f upVector</div><div>...<br><div>}</div></div><div>would allow both ways of setting orientation</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 6, 2020 at 6:43 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>I looked at the abstract and Java SAI spec. but they do not have more guidance.</div><div dir="auto"><br></div><div dir="auto">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).</div><div dir="auto"><br></div><div dir="auto">Of course, this is quite a lot to deduce from a few lines in the spec.</div><div dir="auto"><br></div><div dir="auto">my 2c,</div><div dir="auto"><br></div><div dir="auto">Andreas<br><br><div dir="auto">---on the phone---</div><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Thu, Mar 5, 2020, 4:04 PM Joseph D Williams <<a href="mailto:joedwil@earthlink.net" rel="noreferrer" target="_blank">joedwil@earthlink.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><ul style="margin-top:0in" type="disc"><li style="margin-left:0in">So I would guess for ecmascript it should<u></u><u></u></li></ul><p class="MsoNormal">be rot.y = 1.0</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">me too because rot values can be set as rot.x rot.y rot.z and rot.a </p><p class="MsoNormal">and axis can be set by by axis.x axis.y and axis.z</p><p class="MsoNormal">so in this example the last one set is the final value. </p><p class="MsoNormal">Joe</p><p class="MsoNormal"><u></u> <u></u></p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:andreasplesch@gmail.com" rel="noreferrer noreferrer" target="_blank">Andreas Plesch</a><br><b>Sent: </b>Tuesday, March 3, 2020 7:08 AM<br><b>To: </b><a href="mailto:x3d-public@web3d.org" rel="noreferrer noreferrer" target="_blank">X3D Graphics public mailing list</a><br><b>Subject: </b>[x3d-public] SFRotation constructor axis argument by reference orvalue ?</p></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In the ecmascript SAI, SFRotation has a constructor which has the</p><p class="MsoNormal">rotation axis as a SFVec3f argument:</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">new SFRotation ( SFVec3f axis, numeric angle )</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><a href="https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation" rel="noreferrer noreferrer" target="_blank">https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation</a></p><p class="MsoNormal">(Table 7.18, -url in the first sentence is off-)</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The question is when I make a new SFRotation and later change the</p><p class="MsoNormal">SFVec3f which was used for the axis, does the previously constructed</p><p class="MsoNormal">SFRotation also change ?</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">axis = new SFVec3f ( 0, 0, 1 );</p><p class="MsoNormal">rot = new SFRotation( axis, 3.14 );</p><p class="MsoNormal">axis.y = 1.0</p><p class="MsoNormal">axis.z = 0.0</p><p class="MsoNormal">// rot.y is ?</p><p class="MsoNormal">// constructed by value: rot.y = 0.0</p><p class="MsoNormal">// constructed by reference: rot.y = 1.0</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I did not check the abstract SAI spec. for guidance so it is very</p><p class="MsoNormal">possible I missed something.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">This is just an example. There are of course other constructors which</p><p class="MsoNormal">use objects as parameters. It is also probably rare that a script</p><p class="MsoNormal">would want to do this.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It may depend on the scripting language. In ecmascript objects are</p><p class="MsoNormal">passed by reference, you have to explicitly make a copy if you need</p><p class="MsoNormal">it. This is for performance. So I would guess for ecmascript it should</p><p class="MsoNormal">be rot.y = 1.0 .</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">-Andreas</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">-- </p><p class="MsoNormal">Andreas Plesch</p><p class="MsoNormal">Waltham, MA 02453</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">_______________________________________________</p><p class="MsoNormal">x3d-public mailing list</p><p class="MsoNormal"><a href="mailto:x3d-public@web3d.org" rel="noreferrer noreferrer" target="_blank">x3d-public@web3d.org</a></p><p class="MsoNormal"><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></p><p class="MsoNormal"><u></u> <u></u></p></div></div></blockquote></div>
</div></div>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>