Redbeard wrote: > Hi, > > I am using the setViewMatrixAsLookAt to set up my camera. > > I have set up my camera as follows: > > > > viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(XCoordinate,YCoordinate,ZCoordinate), > > osg::Vec3(XCoordinate - > > 10*cos(osg::DegreesToRadians(Pitch))*sin(osg::DegreesToRadians(Yaw)),YCoordinate > > + > > 10*cos(osg::DegreesToRadians(Pitch))*cos(osg::DegreesToRadians(Yaw)),ZCoordinate > > + 10*sin(osg::DegreesToRadians(Pitch))), osg::Vec3(0.0, 0.0, 1.0)); > > > My XCoordinate, YCoordinate and ZCoordinate values remain constant over the > whole code and the values of Roll, Pitch, Yaw change and yet when the Roll, > Pitch, Yaw are changed, the position of the camera's eye is being changed. > Even though I defined the eye's position as > osg::Vec3(XCoordinate,YCoordinate,ZCoordinate). Seems a bit odd for me to > understand why this is happening. > > Also, if I know the camera's location(X,Y,Z) and orientation (Roll, Pitch, > Yaw), is there any easy function to set the view of the camera instead of > doing vector math on paper and setting it up using (eye, dir, up)? > > > Thank you! > > Cheers, > John
------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26404#26404 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org