The camera's orthonormal frame can be obtained as follows...

osg::Matrixd vm = View->getCamera()->getViewMatrix();
osg::Vec3d Forward;
osg::Vec3d Right;
osg::Vec3d Up;
Forward[0] = -vm(0,2);
Forward[1] = -vm(1,2);
Forward[2] = -vm(2,2);
Right[0] = vm(0,0);
Right[1] = vm(1,0);
Right[2] = vm(2,0);
Up[0] = vm(0,1);
Up[1] = vm(1,1);
Up[2] = vm(2,1);

The "Forward" vector is the normal to the view plane...:)

-Shayne

-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Yurii
Monakov
Sent: Tuesday, April 28, 2009 10:32 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] The normal of my screen

Computing (center - eye).normalize() we are doing unnecessary work. Look
direction could be obtained directly from camera's matrix.


2009/4/28 Jean-Sébastien Guay <jean-sebastien.g...@cm-labs.com>


        Hi Mangu,



                If the the center is what I look at, so basically it's the
normal of the plane ( described by the screen) isn't it??
                


        Both eye and center are points, not vectors. So center can't be the
normal of the screen's plane... (center - eye).normalize() is.
        
        J-S
        -- 
        ______________________________________________________
        Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                                      http://www.cm-labs.com/
                               http://whitestar02.webhop.org/

        _______________________________________________
        osg-users mailing list
        osg-users@lists.openscenegraph.org
        
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
        


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to