View Single Post
  #13  
Old 07-29-2014, 06:06 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
Here's an example where the wheelbarrow goes up a ramp with the viewpoint:

Code:
import viz

viz.setMultiSample(4)
viz.fov(60)
viz.go()

viz.clearcolor(viz.SLATE)
viz.addChild('ground.osgb')

viz.MainView.collision( viz.ON )
#Make gravity weaker.
viz.MainView.gravity(2)

quad = viz.addTexQuad(pos=[0,0,4],euler=[0,65,0],scale=[2,10,1],color=viz.RED)
quad2 = viz.addTexQuad(pos=[0,0,14],euler=[180,65,0],scale=[2,10,1],color=viz.RED)

wheelbarrow = viz.addChild('wheelbarrow.ive')
#Disable intersection so wheelbarrow does not collide with view
wheelbarrow.disable(viz.INTERSECTION)

wheelLink = viz.link(viz.MainView,wheelbarrow)
#move wheelbarrow to ground level
wheelLink.preTrans([0,-1.8,0])

view = viz.addView()
view.setPosition([-20,5,9])
view.setEuler([90,15,0])
window = viz.addWindow(view=view)
window.setSize([.4,.4])
window.setPosition([0,1])
Reply With Quote