http://stderr.org/doc/openscenegraph-doc/openscenegraph/classosg_1_1Camera.htmlprovides the method for doing just that
void setViewMatrixAsLookAt<http://stderr.org/doc/openscenegraph-doc/openscenegraph/classosg_1_1Camera.html#ffdfac8750ae789faa395d44443e8d4e>(const osg::Vec3<http://stderr.org/doc/openscenegraph-doc/openscenegraph/classosg_1_1Vec3f.html>&eye, const osg::Vec3<http://stderr.org/doc/openscenegraph-doc/openscenegraph/classosg_1_1Vec3f.html>¢er, const osg::Vec3<http://stderr.org/doc/openscenegraph-doc/openscenegraph/classosg_1_1Vec3f.html>&up) It sounds like that would be more appropriate for your situation. On Wed, Nov 5, 2008 at 4:03 PM, Allen <[EMAIL PROTECTED]> wrote: > Hi, I'm new to OSG and am in need of assistance with how to position a > camera in a scene. I am using OSG 2.6.1 on linux (centos4). Here's my > setting: 1) I've setup my scene (only one node - terrain). 2) I've setup my > 1 and only 1 camera in my only viewer by calling: > setProjectionMatrixAsPerspective ( 30.0f, static_cast<double> ( width ) > /static_cast<double> ( height ), 1.0f, 10000.0f ); > 3) I CAN add a slave camera & translate it in ONLY the x & y planes. I can > scale too but this still is not what I'm looking for. > > My Question: How to I get my Camera to be positioned at a certain spot > over my terrain and looking at a particular spot on my terrain? For the > life of me, I can't figure this out & I"ve been pouring through dozens of > examples, the API, and trying all sorts of experiments with EVERY camera > method I can find, view & viewer method I can find that might help me. > > Thx everyone for your help. I really appreciate this. > > -- > Sincerely, Allen > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

