hi all, am new to this world and i am trying to do a final project with GSO 
VRPN.

i'm trying to create a program with heatracking, well I got that when I move 
the image to move, just to prove that I do correctly, by VRPN.

Well when that happens, the next thing I'm trying to do is create a sphere in 
which it has a camera attached, so that when I move the sphere through 
nodetrackermanipulator, to continue, so that if an object in front and I move 
my head to get something like the following:

In youtube search: "Head Tracking for Desktop VR Displays using the WiiRemote"

Now my problem is this, do not get any of the ways that the camera following 
the ball in question was created, I tried the following:

osg :: ref_ptr <osg::Node> model = sphere ();

osg :: ref_ptr <osg::MatrixTransform> mt = new osg :: MatrixTransform;
mt-> addChild (model.get ());

osg :: ref_ptr <osg::Camera> osg :: camera = new Camera;
camera-> setClearMask (GL_DEPTH_BUFFER_BIT);
camera-> setRenderOrder (osg :: Camera :: POST_RENDER);
camera-> setReferenceFrame (osg :: Camera :: ABSOLUTE_RF);
camera-> setViewMatrixAsLookAt (
     osg :: vec3 (0.0f, 0.0f, 0.0f),
     osg :: vec3 (),
     osg :: vec3 (0.0f, 0.0f, 0.0f)
);
camera-> addChild (mt.get ());

osgGA :: NodeTrackerManipulator * tm = new osgGA :: NodeTrackerManipulator;
tm-> setTrackerMode (osgGA :: NodeTrackerManipulator :: 
NODE_CENTER_AND_ROTATION);
tm-> setRotationMode (osgGA :: NodeTrackerManipulator :: TRACKBALL);
tm-> setTrackNode (Camera.get ());

viewer.setCameraManipulator (tm);

What you get with this through GUIEventHandler, is to move the sphere, without 
the camera to follow.

What am I doing wrong?

Not if you have something to do with the topic of coordinates and coordinate 
diferntes SYSTEMS has the object relative to the viewer, not that I am wrong.

really thank you, i hope you can help, cause im really lost, and i dont know 
what to do :(

Cheers,
David

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47743#47743





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to