View Single Post
  #1  
Old 06-29-2009, 11:31 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Mouselook & Keyboard Navigation

We are building a virtual training environment. And we would like to implement 'mouselook' and the standard FPS keyboard movement keys. We have it set up to move with the keyboard and it works fine:

keyTracker =viztracker.Keyboard6DOF(forward='w',backward='s', left='a',right='d',turnRight='e',turnLeft='q')
keyLink = viz.link(keyTracker, viz.MainView)
keyLink.enable()


And we can do 'mouselook' how we want it:

def mousemove(e):
euler = view.get(viz.HEAD_EULER)
euler[0] += e.dx*0.1
euler[1] += -e.dy*0.1
euler[1] = viz.clamp(euler[1],-90.0,90.0)
view.rotate(euler,viz.HEAD_ORI)

viz.callback(viz.MOUSE_MOVE_EVENT,mousemove)
viz.setMouseOverride()


However, when we try to implement both in the same program, one overrides the other and we only get one of the two navigation modes. I assume this is because we are implementing the two navigation modes in different ways.
Does anyone have some quick and easy code that will allow for navigation using both methods?
Reply With Quote