MaxScript Viewport Rotate center

MaxScript Viewport Rotate center

Anonymous
Not applicable
886 Views
0 Replies
Message 1 of 1

MaxScript Viewport Rotate center

Anonymous
Not applicable

Hi all,

I hope you can help me, i'm stuck from a couple of month on this.

 

I'm trying to write a script that let me rotate,pan and zoom the active viewport via maxscript.
I'm getting crazy on the rotate part, i can't understand how to set up the center of the rotation.

 

MaxScript help shows this method:

 

<boolean>viewport.rotate <quat> [center:<Point3>]

 

I undestand that the Quat part is the rotation vector and angle about the viewport to rotate and if i try the example showed in the help all works like aspected but if try to define the center value, the viewport always rotates about the world origin (0,0,0) and move the viewport on the x and y axis of the viewport.

 

My Example script :

 

theAxis = (viewport.getTM()).row3
for i = 1 to 180 do
(
viewport.rotate (quat 2 theAxis) center:[10,10,0]
completeredraw()
)

I try to set the Tm of the viewport and other things but always the result is rotating around  the origin with weird effect.

 

What i'm missing to define the center of rotation?


Thank to all and sorry for my bad english.

 

Best regards,

 

Gabriele

 

 

 

0 Likes
887 Views
0 Replies
Replies (0)