Thread: viewing issue.
View Single Post
  #4  
Old 03-29-2006, 12:03 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

You have a couple options. You can use the view.goto function to animate the viewpoint moving to certains predetermined locations. Take a look at the animateview.py example in the [Vizard25]/examples/advanced directory.

You can also create an animation path. Take a look at the animatepath.py script in the same directory. Instead of linking the animation path to the ball, you can link it to the viewpoint.

If you have version 2.53 you can use the vizcam module to create a camera that orbits around a specified location. Here is a sample script using the vizcam module that creates 4 waypoints and cycles through them.
Code:
import viz
viz.go()

viz.add('tut_ground.wrl')
logo = viz.add('logo.wrl')
logo.translate(0,1,0)
viz.clearcolor(viz.SKYBLUE)

import vizcam
cam = vizcam.PivotAnimate()
cam.setPivot(0,1,0)
cam.setAutoMode(0)

CAM_SPEED = 2

locations = [ [0,1,-5] , [3,0.5,0] , [0,1.5,4], [-2,0.1,0] ]

cam.curLocation = 0
cam.gotoPosition(locations[0],CAM_SPEED)

def endcam(e):
	cam.curLocation = (cam.curLocation+1) % len(locations)
	cam.gotoPosition(locations[cam.curLocation],CAM_SPEED)
viz.callback(vizcam.END_PIVOTCAM_EVENT,endcam)
Let me know if you need more information on any of these methods.
Reply With Quote