[osg-users] Camera control and view matrix

Brian R Hill bhill22 at csc.com
Wed Sep 17 07:54:32 PDT 2008


Here's what I do using euler angles (_camAng) and position (_camPos).

osg::Quat quat(_camAng[0],osg::X_AXIS,_camAng[1],osg::Y_AXIS,_camAng
[2],osg::Z_AXIS);
osg::Matrix viewMat = osg::Matrix::rotate(quat) * osg::Matrix::translate
(_camPos);
viewMat.preMult(osg::Matrix::rotate(osg::PI_2,osg::X_AXIS));
viewMat.invert(viewMat);
_camera->setViewMatrix(viewMat);

Brian

 -----osg-users-bounces at lists.openscenegraph.org wrote: -----

To: "OSG Mailing List" <osg-users at lists.openscenegraph.org>
From: "Renan Mendes" <renanmzmendes at gmail.com>
Sent by: osg-users-bounces at lists.openscenegraph.org
Date: 09/17/2008 10:30AM
Subject: [osg-users] Camera control and view matrix

Hi,

    I need some references on camera control and view matrices. The
    tutorial in OSG's website is outdated, for it still makes use of
    osg::Producer. Can anyone send me a few suggestions?


                 Thanks,

                       Renan M Z Mendes

_______________________________________________
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