WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-12-2009, 02:38 AM
nasr nasr is offline
Member
 
Join Date: Apr 2009
Posts: 27
how to do it using mouse

Code:
def toggleLink():
    global link
    if link:
        #If link exits, stop grabbing
        link.remove()
        link = None
    else:
        #If no link, grab the ball with the hand
        link = viz.grab( hand,ball )
       
vizact.onkeydown(' ',toggleLink)


#Setup keyboard control of hand and ball
vizact.whilekeydown(viz.KEY_UP,hand.translate,0,vizact.elapsed(1),0,viz.RELATIVE_WORLD)
vizact.whilekeydown(viz.KEY_DOWN,hand.translate,0,vizact.elapsed(-1),0,viz.RELATIVE_WORLD)
vizact.whilekeydown(viz.KEY_RIGHT,hand.translate,vizact.elapsed(1),0,0,viz.RELATIVE_WORLD)
vizact.whilekeydown(viz.KEY_LEFT,hand.translate,vizact.elapsed(-1),0,0,viz.RELATIVE_WORLD)
vizact.whilekeydown(viz.KEY_RETURN,hand.translate,0,0,vizact.elapsed(1),viz.RELATIVE_WORLD)
vizact.whilekeydown(viz.KEY_SHIFT_R,hand.translate,0,0,vizact.elapsed(-1),viz.RELATIVE_WORLD)


vizact.whilekeydown('w',hand.rotate,1,0,0,vizact.elapsed(90),viz.RELATIVE_WORLD)
vizact.whilekeydown('s',hand.rotate,1,0,0,vizact.elapsed(-90),viz.RELATIVE_WORLD)
vizact.whilekeydown('d',hand.rotate,0,1,0,vizact.elapsed(90),viz.RELATIVE_WORLD)
vizact.whilekeydown('a',hand.rotate,0,1,0,vizact.elapsed(-90),viz.RELATIVE_WORLD)
vizact.whilekeydown('c',hand.rotate,0,0,1,vizact.elapsed(90),viz.RELATIVE_WORLD)
vizact.whilekeydown('x',hand.rotate,0,0,1,vizact.elapsed(-90),viz.RELATIVE_WORLD)

i want to do the same using mouse.. how to translate and rotate. im using a marker and linking it with the mouse pointer..how can i rotate the ball using the mouse?

thanking you all
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
set mouse position AlyssaK Vizard 1 01-28-2009 04:05 PM
multiple mouse clicks jaclyn.bill Vizard 2 06-03-2008 02:19 AM
Mouse problem steve Vizard 7 07-14-2005 03:01 PM
Draw Line between Points selected by mouse Johannes Vizard 7 01-07-2005 02:50 PM
Halting mouse view-transforms FlyingWren Vizard 1 10-01-2003 05:29 PM


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


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