View Single Post
  #2  
Old 01-05-2009, 09:02 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
for your first question you could just add a textbox to your screen instead of text
Code:
speed = viz.addTextbox(parent = viz.SCREEN)
add the textbox and set its position outside of your timer function and then change the message in the timer function.

I not sure if I understand your second question. If you only want to move in the y direction then you could just remove the code that updates the x position and turns the viewpoint from UpdateJoystick()

Code:
def UpdateJoystick():
    #Get the joystick position
    x,y,z = joy.getPosition()

    #Move the viewpoint forward/backward based on y-axis value
    if abs(y) > 0.2: #Make sure value is above a certain threshold
        viz.MainView.move(0,0,-y*0.1,viz.BODY_ORI)
you can multiply the y value by something else if you want it to update by a different amount.
Reply With Quote