problems with the function setRotation of camera in Z axis

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
masfworld
Posts: 9
Joined: Thu Sep 30, 2004 10:29 pm

problems with the function setRotation of camera in Z axis

Post by masfworld »

why the function setRotation not work good where i want rotate in Z axis, that is

Code: Select all

camera->setRotation(core::vector3df(0,0,-2));
however, the function work well in X and Y axis.
the camera is a fps camera.

thank you
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

you have to change upvector of camera.
cameranode->setUpVector(vector3df)
masfworld
Posts: 9
Joined: Thu Sep 30, 2004 10:29 pm

Post by masfworld »

[quote="arras"] i have tested camera setUpVector and it don't work well.
For example, i want rotate in Z axis 15 degrees, i put

Code: Select all

camera->setRotation(core::vector3df(0,0,15));
camera->setUpVector(core::vector3df(0,0,15));
this code don't work well. can you help me? thank you
Post Reply