[API] Rotate view in global coordinates

[API] Rotate view in global coordinates

Anonymous
Not applicable
871 Views
1 Reply
Message 1 of 2

[API] Rotate view in global coordinates

Anonymous
Not applicable

Hi.

I'm using this code to achieve view rotation:

https://adndevblog.typepad.com/manufacturing/2014/11/rotate-camera-around-any-axis-any-angle.html

 

Basically it transforms Camera.Eye and Camera.UpVector by rotation matrix created from given vector (the rotation axis), angle and point.

Let the vector be [1,0,0] so it means rotation by X axis.

However applying rotation (transform) to the camera object causes the part to rotate around its local X axis. So if I change starting orientation of the part, it revolves around its local X axis which is now different.

I need to rotate the part around fixed axis (global X axis irrelevant of current part orientation).

How can I accomplish this?

 

Regards,

Evan

0 Likes
872 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Ok found it. For furure reference:

use Inventor.Camera.ViewToWorld (Matrix) property.