![]() |
|
|
|
#1
|
|||
|
|||
|
Sorry, I'm not sure I understand your question
|
|
#2
|
|||
|
|||
|
ok don't warry about that i tried your suggestion and it works but i have anather problem i want an object is close enough to be child it not allawed to move in all directions in other words i want the object to move only in one axis (x for example) so it only sliding along this axis
and thx again |
|
#3
|
|||
|
|||
|
If you want to move your object with the mouse along just the x-axis you could either translate mouse movement into object movement with something like this
Code:
#Disable mouse navigation
viz.mouse(viz.OFF)
ball = viz.add('ball.wrl')
def mymouse(e):
#Move the object based on the mouse position
ball.setPosition((e.x-0.5)*6,2,8)
viz.callback(viz.MOUSE_MOVE_EVENT, mymouse)
Code:
#Disable mouse navigation
viz.mouse(viz.OFF)
ball = viz.add('ball.wrl', pos = [0,2,8])
#use buttons to control ball
vizact.whilemousedown(viz.MOUSEBUTTON_LEFT, ball.translate,vizact.elapsed(-1),0,0,viz.REL_PARENT)
vizact.whilemousedown(viz.MOUSEBUTTON_RIGHT, ball.translate,vizact.elapsed(1),0,0,viz.REL_PARENT)
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sharing Files on SourceForge | farshizzo | Vizard | 1 | 09-03-2012 11:18 AM |
| Need help with a project | mberkes | Vizard | 14 | 05-27-2009 11:54 AM |
| Project .avi or .mpeg file | pattie | Vizard | 2 | 02-06-2007 08:09 AM |