[vtkusers] coordination of camera and actor.

Yongjian Guo yguo at osf1.gmu.edu
Mon Jun 18 15:51:01 EDT 2001


Hi, 

In the application I am writting, I hope to let the actor's orientation
unchanged before the camera, which can be moved. Here is what I have
done:

I use the following code to adjust the camera orientation. 

    $CurrentCamera Azimuth [expr ($LastX -$x)]
    $CurrentCamera Elevation [expr ($y - $LastY)]
    $CurrentCamera OrthogonalizeViewUp 

And I use the method GetOrientation of the camera to get the camera's
orientation change. I guess the results are the angel changing arround x,
y and z. (Am I right? ) Then give the offset to the actor by the following
code
	boxActor RotateX [expr 0 - changeX]
	boxActor RotateY [expr 0 - changeY]
	boxActor RotateZ [expr 0 - changeZ]

It is correct for X and Y direction. But the Z direction is not
correct. Can someone tell me where is wrong? 


Thanks, 


Yongjian





More information about the vtkusers mailing list