Hi Diana,
I find it pretty convenient to use
Code:
getCamera()->setViewMatrixAsLookAt (const osg::Vec3 &eye, const osg::Vec3
¢er, const osg::Vec3 &up)
for setting up the view matrix, it was one of Robert's suggestions but I
thought I'd re-emphasize it. Vec3 "eye" will be the position you're getting
from the server. Vec3 "center" will be the point the camera is aiming at - it
doesn't have to be the center of the scene, if you are given or can calculate
the direction vector the camera is pointing along, (0,1,0) for example to look
along the y-axis, you can add that to your "eye" point and use the result as
"center". Vec3 "up" orients the camera, think about taking a photo in portrait
vs landscape vs some other angle.
To start if you know the coordinates of some point in the scene, you could use
that as "center" and just play with changing "eye", the camera will always look
at the same point ("center") but from different places. After that, you could
then work on calculating "center" based on the orientation you're receiving
from the server.
HTH,
Cheers,
Tom
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=40217#40217
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org