WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Spin Actions and rotations (https://forum.worldviz.com/showthread.php?t=1252)

Vinicius Lima 10-20-2007 11:01 AM

Spin Actions and rotations
 
Hello,

Would it be possible to post here a sampel script where objects spin away from the origin? I've tried many times to make it work and it appears that the software only understands the origin at (0,0,0).

Thanks,

Vinicius

farshizzo 10-22-2007 11:49 AM

Here is a sample script that spins a ball around a center. There are many ways to do this, this example simply sets the center of the ball away from the origin.
Code:

import viz
viz.go()

RADIUS = 2
CENTER = [0,0,0]

ball = viz.add('ball.wrl')
ball.center(-RADIUS,0,0)
ball.translate(CENTER[0]+RADIUS,CENTER[1],CENTER[2])
ball.addAction(vizact.spin(0,1,0,90))

viz.add('tut_ground.wrl')
viz.MainView.move(0,0,-10)



All times are GMT -7. The time now is 09:06 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC