PDA

View Full Version : viewing issue.


cantwelljm
03-25-2006, 12:27 PM
Hi, my issue concerns the viewing of a building which i have imported to vizard. My question is has vizard the functionality to view my building by creating a camera view which orbits the building (fly through) ? I am relatively new to vizard and have limited script knowledge. If there is a solution to my concern, does it require much scripting and does it require much work?? Any help would be greatly appreciated as i've to present my building to an audience next week!!!

Regards, John

farshizzo
03-27-2006, 12:14 PM
Hi,

By "orbit" do you mean following a pre-determined path or do you want to control the orbit at runtime?

cantwelljm
03-29-2006, 06:42 AM
Hi,
Thank you for your reply. By "orbit" i mean a predetermined path around the model. Looking forward to your reply...
...regards john.

farshizzo
03-29-2006, 12:03 PM
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.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.