Hi all,
 
I'm working on a remotely controlled virtual reality world. I've used the 10loading example for a start and added functionality so I can receive UDP messages that tell me the viewpoint (that message contains 6 floats: x, y, z position and x,y,z rotation). From this viewpoint I "fly" through an imported 3DS-file.
By creating a thread that runs simultaniously with OpenSG, I want to update the viewpoint with the UDP-data. This works fine for the x,y,z position and (though not yet bug-free) works with the roll and pitch (by setting the up-vector). The only problem is that i can't update the rotation angle? In my code below you can see that i use setRotationAngle and I check the value a little later by getRotationAngle which shows me that the value is set. Only problem is that in my window the view does not rotate!
Am I using the correct function (setRotationAngle) for changing the view?
Why does this function seem to have no effect?
 
Thanks for any help,
 
Paul de Wit
 
 
void viewpoint(void *dummy3) {
stindata std; //UDP-data struct
Navigator *nav = mgr->getNavigator();
Pnt3f from;
Vec3f up;
Real32 angle;

while (1){
  getdata(std); //get UDP-data
  from[0] = std.x*1000; //fill 3D-point X
  from[1] = std.y*1000; //fill 3D-point Y
  from[2] = std.z*1000; //fill 3D-point Z
  up[0] = std.p; //fill 3D-vector x-direction
  up[1] = std.r; //fill 3D-vector y-direction
  up[2] = -std.h; //fill 3D-vector z-direction
  nav->setFrom(from); //set Position in space
  nav->setRotationAngle(std.r-Pi); //set Rotation in space
  nav->setUp(up); //set Up-vector
  printf("\t%f\n",std.r-Pi);
  glutPostRedisplay(); //Update window
  angle = nav->getRotationAngle(); //Check rotation
  printf("\t\t%f\n",angle);
  MsgWaitForMultipleObjects(0,0,0,50,0); //Wait 50msec for next viewpoint update
}
 
}

Reply via email to