[osg-users] Getting model's direction vector from MatrixTransform?

Ümit Uzun umituzun84 at gmail.com
Sun Mar 29 14:45:10 PDT 2009


Hi All,

I have an simple math question which I had resolved before but now I can't
figure out what would be the problem. I have car model which's direction is
x coordinate. I want to translate it by using it's current direction. So I
need to know it's next visit coordinate while it is rotating to left or
right. So this is my math;

carMatrixTransform->get(quad);
osg::Vec3d carDirection = quad * osg::Vec3d(1.0, 0.0, 0.0); // getting car's
x direction vector.

Then using carDirection, I calculate each next related coordinates
respectively by using iterator.

osg::Vec3d DestinationPos, SourcePos;
DestinationPos = SourcePos + carDirection * iterator; (iterator >= 0)

Do you think it is wrong?

Best Regards.


-- 
Ümit Uzun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090330/9486ec5f/attachment-0002.htm>


More information about the osg-users mailing list