WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-06-2005, 11:00 AM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Move Objects

Hi,
I'm trying to move a ball through a room.
I know that there are certain built in functions to move it, but as I want to be very flexible I want / have to write my own movement-function.

def moveIt2():
for i in range(1,10):
print 'hallo',i
x=x0+i*0.01
y=y0+i*0,03
ball.translate(x,y,6)
i=i+1
time.sleep(0.1)

But it does not seem to work.

Without the ball.translate(x,y,6) the Function seems to work. But it prints out the numbers as a whole after in this case 1 seconds

What would you recommend for moving an object?

I know about ball.goto(3,3,6,5) or the timer-funktion-based movement. But as I want to slow down the motion sometimes (and not change speed) I will need my own timer - this is why I tried the sleep-command.

Thank you,
Johannes
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC