Thread: 3D world editor
View Single Post
  #2  
Old 05-01-2012, 06:52 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could try using a viztracker.MouseTracker. Here's a simple example:
Code:
import viz
import viztracker
import vizact
viz.go()

gallery = viz.addChild('gallery.osgb')
ball = viz.addChild('soccerball.osgb')

#Move the object with mouse movements and mousewheel
mousetracker = viztracker.MouseTracker()
link = viz.link(mousetracker,ball)

#Disable the link and place the object with a mousepress
vizact.onmousedown(viz.MOUSEBUTTON_LEFT, link.disable)

viz.mouse(viz.OFF)
Reply With Quote