PDA

View Full Version : 3d model rotation?


howard
10-02-2003, 02:16 PM
is there any way to rotate a 3d model? instead 'absolute' rotate, I need 'relative' rotate a 3d model imported from wrl fie.
Thanks in advance

Howard

farshizzo
10-02-2003, 02:36 PM
Hi Howard,

The following example will rotate a model 45 degrees along the absolute y axis:
model.rotate(0,1,0,45,viz.RELATIVE)
The following example will rotate a model 45 degrees along its local y axis:
viz.rotate(model,viz.YAXIS,45)
If you need more advanced control you could use the Transform class. Here's a simple example:
import vizmat
X = vizmat.Transform()

X.makeRot(0,1,0,90)
X.postRot(0,1,45)

model.update(X)
Hope this helps!

howard
10-02-2003, 05:35 PM
Hi, farshizzo
Yes, it's what I'm looking for.
thank you.