Hi,

I'm guessing here, but I think you might be misunderstanding what the "from" and "to" parameters for makeRotate do. It creates a rotation from one _vector_ to another, not from one position to another (have a look at the makeRotate docs in osg::Quat). You could try to use a unit vector (to the nose of your model) as "from" and then now-previous as "to", which should at least make your model point in the right direction, but this is still not enough info to get the roll of the model. IOW makeRotate cannot magically from 2 vectors figure out 3 rotations. If your model only rotates in a horizontal plane, then makeRotate would appear to work, but otherwise you'd be better off calculating 3 rotations yourself.

jp

Michael Weber wrote:
Well, my programm is pretty much like the osgsimulation example. But instead of 
a aircraft which flies a constant route I use a model which flies an arbitrary 
trajectory.

For the positioning of the model I just use makeTranslate with the new X,Y,Z 
coordinates, which works as expected.

Now I try to rotate my model that way that it heads towards the direction it is 
"flying". For the rotation I use makeRotate with the new position and the 
previous position (taken from here 
(http://forum.openscenegraph.org/viewtopic.php?p=16587#16587)).

But somehow it works not as expected. The model always looks somewhere else. So 
I suppose either I use the makeRotate in a wrong way or the rotation somehow 
depends on the position within the EllipsoidModel (maybe some conversion from 
world to local coordinates or vice versa?)

Any ideas?

Michael

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to