WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-10-2009, 10:26 PM
nlfrnassimi nlfrnassimi is offline
Member
 
Join Date: Feb 2009
Posts: 37
how can I stop an action?

I've solved the problem of selecting and moving an object but now I can't deselect the object.

when I choose my first object and move it, it works properly but when i select my second object the first one moves also. how can i stop the first one?

this is the code i wrote:

import viz

viz.go()

viz.add('tut_ground.wrl')
viz.clearcolor(0.5,0.5,1)

soccerball1 = viz.add('soccerball.ive')
soccerball2 = viz.add('soccerball.ive')
soccerball3 = viz.add('soccerball.ive')

soccerball1.translate(-1,1.5,3)
soccerball2.translate(0,1.5,3)
soccerball3.translate(1,1.5,3)

arrow = viz.add('arrow.wrl')
arrow.scale(.1,.1,.1)
arrow.visible(viz.OFF)

def mouseclick(button):
if button == viz.MOUSEBUTTON_LEFT:
ball = viz.pick()
if ball.valid():
vizact.whilekeydown( viz.KEY_UP, ball.translate, 0, vizact.elapsed(1), 0, viz.REL_PARENT )
vizact.whilekeydown( viz.KEY_DOWN, ball.translate, 0, vizact.elapsed(-1), 0, viz.REL_PARENT )
vizact.whilekeydown( viz.KEY_RIGHT, ball.translate, vizact.elapsed(1), 0, 0, viz.REL_PARENT )
vizact.whilekeydown( viz.KEY_LEFT, ball.translate, vizact.elapsed(-1), 0, 0, viz.REL_PARENT )

pos = ball.get(viz.POSITION)
pos[1] +=.2
arrow.translate(pos)
arrow.visible(viz.ON)



viz.callback(viz.MOUSEDOWN_EVENT,mouseclick)

viz.mouse(viz.OFF)
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop for... loop Johannes Vizard 20 04-01-2014 01:53 AM
How to stop vizact.move Jerry Vizard 3 06-04-2009 04:25 PM
delays with <avatar>.act and speech vsully Vizard 15 08-23-2007 04:24 PM
When a video stop ? djdesmangles Vizard 2 01-11-2007 04:15 PM
download problems & avatar action vgracie Vizard 1 09-14-2006 11:29 AM


All times are GMT -7. The time now is 04:20 PM.


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