Unable to manipulate camera parameters to rotate camera around z axis

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to manipulate camera parameters to rotate camera around z axis

Vinmean
This post has NOT been accepted by the mailing list yet.
This post was updated on .
I am trying to rotate the camera around each axis (origin is the (0,0,0) of the point cloud). My understanding is that the up vector of the camera and the vector formed by the focal and position 3D points controls the orientation of the camera. So if I do a 3D affine transform of these three points I can get any camera position&orientation I want.

A rotation of 30 degrees around the z axis will need the following parameters to be passed to the setCameraPosition funciton.
viz->setCameraPosition(0,0, 2500,
                                  -0.5, 0.866025, 0
                                   0,0,0);

But the camera doesn't seem to rotate around the Z axis. I dont see any visible change in the rendered image.

For 30 degree around the x axis I used the below function call. It works like a charm.
viz->setCameraPosition(0, -1250, 2165.06,
                                   0, 0.866025, 0.5,
                                   0,0,0);

Rotation around y axis also works. Why am I not able to rotate the camera around its Z axis? Is my understanding of the up vector wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to manipulate camera parameters to rotate camera around z axis

Frederik
Hi,

It appears that you are using the function in the wrong way:

setCameraPosition (double pos_x, double pos_y, double pos_z, double view_x, double view_y, double view_z, double up_x, double up_y, double up_z, int viewport=0)

Your up-vector is (0,0,0)?, the standard would be (0,1,0) where a 180 degree rotation would result in (0,-1,0).

Reply | Threaded
Open this post in threaded view
|

Re: Unable to manipulate camera parameters to rotate camera around z axis

Vinmean
This post has NOT been accepted by the mailing list yet.
Thanks Frederik, I got it right now. Confusion because of the variable naming convention.