#1
|
|||
|
|||
moving object forward backward
When the mouse is pointed at the object I want to move it depending on wich key i press. A normal int number works but example +=0.5 does not work.
Code: Code:
cube = vizshape.addCube() def moveForward(): object = viz.pick() if object.valid(): pos += 10 object.setPosition([pos],0,0) print 'move backward' vizact.onkeydown( 'w', moveForward ) def moveBackward (): object = viz.pick() if object.valid(): pos += 10 object.setPosition([pos],0,0) print 'move forward' vizact.onkeydown( 's', moveBackward ) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
retrieve Object names | Geoffrey | Vizard | 11 | 12-11-2009 05:26 AM |
Attaching sound to a moving object | GiudiceLab | Vizard | 6 | 08-21-2009 09:52 AM |
moving and object by mouse but don't know how to stop the movement | nlfrnassimi | Vizard | 8 | 04-26-2009 08:23 AM |
Moving view with object | Xliben | Vizard | 2 | 07-25-2005 06:36 PM |