I can use the regular camera or FPS camera and setUpVector, and setPosition,
but these do not work for Maya camera - my scene displays with the z axis pointing to the right.
I could not find any info on this, how do I set my Maya camera in the correct orientation?
thanks
setUpVector for Maya camera
Re: setUpVector for Maya camera
The Maya camera is controlled by its animator CSceneNodeAnimatorCameraMaya that responds to mouse events. A look to the code of the
animateNode method shows that camera position and up vector are overwritten:
In the initial state when no mouse input occured so far, the vector translate is the target position and nZoom seems to be the distance between target
and camera, which is set to 70 units by default in the constructor. So the camera is initially positioned 70 units in x direction from the target.
And from this point of view, the z axis goes from left to right.
I think it should be possible to change the code so that a start position and orientation entered by the user is kept. Perhaps I'll do this some day !
animateNode method shows that camera position and up vector are overwritten:
Code: Select all
pos = translate;
pos.X += nZoom;
pos.rotateXYBy(nRotY, translate);
pos.rotateXZBy(-nRotX, translate);
camera->setPosition(pos);
camera->setTarget(translate);
// Rotation Error ----------------------------
// jox: fixed bug: jitter when rotating to the top and bottom of y
pos.set(0,1,0);
pos.rotateXYBy(-nRotY);
pos.rotateXZBy(-nRotX+180.f);
camera->setUpVector(pos);
LastCameraTarget = camera->getTarget();
and camera, which is set to 70 units by default in the constructor. So the camera is initially positioned 70 units in x direction from the target.
And from this point of view, the z axis goes from left to right.
I think it should be possible to change the code so that a start position and orientation entered by the user is kept. Perhaps I'll do this some day !