Hi, > osg::Vec3d localEyeOffset2 = rotationMatrix * eyeOffset;
if you swap the order of the matrix and the vector will you get the same result? On Tue, Jan 24, 2017 at 11:25 AM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > Hi, > may be this is a newbie question but I would like to understand the reason > of this behaviour. > > 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. > > osg::Vec3d eyeOffset(0.0, 0.0, 300.0); > osg::Quat rotation(osg::DegreesToRadians(0.0), osg::Z_AXIS, > osg::DegreesToRadians(0.0), osg::Y_AXIS, osg::DegreesToRadians(45.0), > osg::X_AXIS); > osg::Vec3d localEyeOffset = rotation * eyeOffset; > osg::Matrixd rotationMatrix(rotation); > osg::Vec3d localEyeOffset2 = rotationMatrix * eyeOffset; > > I expected to have the same result for localEyeOffset and localEyeOffset2, > while this is what I get: > localEyeOffset is (0.0, -212.132, 212.132) > localEyeOffset2 is (0.0, 212.132, 212.132) > > Can you explain me why? > > Regards, > Gianni > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=70034#70034 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org