View Single Post
Old 09-06-2007, 09:44 AM
Elittdogg Elittdogg is offline
Join Date: Aug 2007
Posts: 77
Question Object animation using a picture?

I need to animate a picture such that it moves forward a bit and backward a bit. Kind of like a moving room. I'm having trouble; here's what I've got:

import viz

tex1 = viz.add('picture.jpg')
quad = viz.add(viz.TEXQUAD)
quad.scale(12.8, 10.24)

moveForward = vizact.move(0,0,2,5)
moveBackward = vizact.move(0,0,-2,5)
MovingRoom = vizact.sequence(moveForward,moveBackward,4)

def onkeydown(key):
if key == ' ':


But when I run the script I get this error message:
Traceback (most recent call last):
File "Moving Room", line 25, in onkeydown
AttributeError: VizTexture instance has no attribute 'add'

Which, I guess, makes sense to me. But I wondering if there is a way around this. Like, how can I make it such that the picture moves forward X distance for Y duration and then backward X distance for Y duration...etc (i.e. put that in a loop/timer). Namely, I'd like the picture to keep moving forward and backward the entire time the script is running.

Thanks for the help.
Reply With Quote