View Single Post
  #2  
Old 10-22-2007, 11:49 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote