<div dir="ltr">Hi,<div><br></div><div><span style="font-size:12.8px">> osg::Vec3d localEyeOffset2 = rotationMatrix * eyeOffset;</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">if you swap the order of the matrix and the vector will you get the same result?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 11:25 AM, Gianni Ambrosio <span dir="ltr"><<a href="mailto:g.ambrosio+osg@gmail.com" target="_blank">g.ambrosio+osg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
may be this is a newbie question but I would like to understand the reason of this behaviour.<br>
<br>
I have to calculate the coordinate of a 3D point wrt a different coordinate reference. The new coordinate reference is simply rotated wrt the first one. I tried two different implementations with different results.<br>
<br>
osg::Vec3d eyeOffset(0.0, 0.0, 300.0);<br>
osg::Quat rotation(osg::<wbr>DegreesToRadians(0.0), osg::Z_AXIS, osg::DegreesToRadians(0.0), osg::Y_AXIS, osg::DegreesToRadians(45.0), osg::X_AXIS);<br>
osg::Vec3d localEyeOffset = rotation * eyeOffset;<br>
osg::Matrixd rotationMatrix(rotation);<br>
osg::Vec3d localEyeOffset2 = rotationMatrix * eyeOffset;<br>
<br>
I expected to have the same result for localEyeOffset and localEyeOffset2, while this is what I get:<br>
localEyeOffset is (0.0, -212.132, 212.132)<br>
localEyeOffset2 is (0.0, 212.132, 212.132)<br>
<br>
Can you explain me why?<br>
<br>
Regards,<br>
Gianni<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=70034#70034" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=70034#<wbr>70034</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>