Hi jp,

Thanks for those suggestions. I implemented them but I am probably still doing 
something wrong as the behavior is not as expected. 

I used the debugger to check the values of the vectors but the numbers dont 
make sense to me. Thus is the case of Down arroy key and thus I used (0, -1, 0) 
as my default forward pointing vector. But what I observed is the object moving 
forward and its y-value increasing instead of decreasing. 

Initial position = positionArray = (132.86, 78.277, 18.48)
Initial attitude= quat = (0, 0, 0.719, 0.695)

vector = quat*(0,-1,0) = (0.99, 0.035, 0.00)
vector*2  = (1.998, 0.069, 0)

PositionArray = PositionArray + vector*2 = (134.86, 78.34, 18.48)
-------------------------------------------------------------------------------

code:

Code:
positionArray = PATCurrent->getPosition();
                        quat = PATCurrent->getAttitude();
                        vector = quat.operator *(osg::Vec3(0, 1.0, 0.0));
                        vector.operator *=(2);
                        positionArray = positionArray.operator +(vector);
                        PATCurrent->setPosition(positionArray);




Best,
Sanat

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29556#29556





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to