[osg-users] How do I calcuate angles between two points?
Hi, My model is at point 2 and I want to rotate it to face Point 1. Point 1 = 30,30,30 Point 2 = 10, 10, 0 How can I calculate the respective angles between two locations? I am familiar with makeRotate and makeLookAt but need the respective angles... Thank you for help on this simple question. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48282#48282 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How do I calcuate angles between two points?
Hin Dan, Makerotate will compute a rotation from front vector P1 to front vector P2. You can decompose the Quat after if you need the angles. Regards, Vincent. Le 13/06/2012 17:29, dan marshal a écrit : Hi, My model is at point 2 and I want to rotate it to face Point 1. Point 1 = 30,30,30 Point 2 = 10, 10, 0 How can I calculate the respective angles between two locations? I am familiar with makeRotate and makeLookAt but need the respective angles... Thank you for help on this simple question. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48282#48282 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How do I calcuate angles between two points?
Using Vincent's method, you don't need the angle. If you do need the angle, you don't need OSG, as trigonometry provides a solution: The dot product of two normalized vectors is the cosine of the angle between them. -Paul On 6/13/2012 9:40 AM, Vincent Bourdier wrote: Hin Dan, Makerotate will compute a rotation from front vector P1 to front vector P2. You can decompose the Quat after if you need the angles. Regards, Vincent. Le 13/06/2012 17:29, dan marshal a écrit : Hi, My model is at point 2 and I want to rotate it to face Point 1. Point 1 = 30,30,30 Point 2 = 10, 10, 0 How can I calculate the respective angles between two locations? I am familiar with makeRotate and makeLookAt but need the respective angles... Thank you for help on this simple question. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48282#48282 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org