setUpVector for Maya camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lfrohman7
Posts: 1
Joined: Sat Jan 06, 2018 7:25 pm

setUpVector for Maya camera

Post by lfrohman7 »

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
manni63
Posts: 12
Joined: Tue Sep 27, 2016 6:23 am

Re: setUpVector for Maya camera

Post by manni63 »

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:

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();
 
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 :D !
Post Reply