Thread: mainview
View Single Post
  #2  
Old 02-18-2009, 02:16 AM
DrunkenBrit DrunkenBrit is offline
Member
 
Join Date: Dec 2008
Location: England
Posts: 25
Code:
viz.MainView.getPosition(female.getPosition())
You're invoking the wrong function for a start, you need to call 'viz.MainView.setPosition' not 'viz.MainView.getPosition'.

This will only occur once though, you'll need a timer callback function to constantly acquire the position of the avatar and assign it to the main view position.

Something like:

Code:
def myTimer(num):
      newPosition = female.getPosition()
      offset = [0,0,5] # Maybe add an offset so the camera isn't directly ontop of the avatar to keep it in view?
      viz.MainView.setPosition(newPosition+offset)

viz.callback(viz.TIMER_EVENT,myTimer) # Pass callback
viz.starttimer(0,0.5,viz.FOREVER) # Start the timer
__________________
Software Developer
Virtalis Ltd.
www.virtalis.com
Reply With Quote