[osg-users] Difference in osg::Matrixd.getTrans() and osg::Matrixd.getLookAt(..)

Robert Osfield robert.osfield at gmail.com
Fri Feb 15 02:15:16 PST 2008


Hi Tobias,

getTrans() and getLookAt() are two very different beasts and have no
direct mapping, getLookAt is based on the OpenGL gluLookAt function so
please refer to OpenGL docs on gluLookAt to understand how its put
together.  getTrans() is just the bottom row of the matrix.

Robert.

On Fri, Feb 1, 2008 at 1:06 PM, Tobias Münch
<muench.tobias at googlemail.com> wrote:
> Hello
>
> I have a osg::Matrixd view matrix and want to get origin of the camera. I
> know two different methods: getTrans() and getLookAt(eye,center,up,dist).
> But both return different results.
>
> For example:
>
>  getTrans() --> (-0.6, -5, -2322)
>
> eye (from getLookAt(..)) --> ( 0.6, -2322, 5)
>
> The values are the same, but order and signs are interchanged. I need both
> vectors in the same format. How can I make this?
>
> _______________________________________________
>  osg-users mailing list
>  osg-users at lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


More information about the osg-users mailing list