View Single Post
  #13  
Old 12-07-2006, 10:18 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Interesting idea to have the view look at a preceding model. A quick and dirty way to get some additional smoothing.

Of course, a smoother view can certenly be acheaved by tweeking the control points. When the view is jumpy, increase the time difference between the two points. If you want to keep the same time between points, you could also add a few more control points in the problem area.

Bellow is a simple script which has the setup for an animation path that a view could use.

Code:
import viz
viz.go()

viz.add('court.ive')

path = viz.add(viz.ANIMATION_PATH)

#Initialize an array of control points
positions = [ [0,1.8,-3], [-3,1.6,1], [3,1,-0.1], [0,0.3,0] ]

for x in range(0,len(positions)):
	#Add a ball at each control point and make it
	#semi-transparent, so the user can see where the
	#control points are
	b = viz.add('ball.wrl')
	b.setPosition(positions[x])
	b.alpha(0.2)
	#Add the control point to the animation path
	#at the new time
	cp = viz.add(viz.CONTROL_POINT)
	cp.setPosition(positions[x])
	path.add(cp,x*5 + 5)

path.translatemode(viz.CUBIC_BEZIER)
path.loop(viz.CIRCULAR)
path.computetangents()
path.autorotate(viz.ON)
path.play()

view = viz.addView()
view.eyeheight(0)
viz.link(path,view)

viz.MainWindow.viewpoint( view )
__________________
Paul Elliott
WorldViz LLC
Reply With Quote