PDA

View Full Version : Spin Actions and rotations


Vinicius Lima
10-20-2007, 11:01 AM
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.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)