View Single Post
  #4  
Old 02-17-2009, 05:33 AM
DrunkenBrit DrunkenBrit is offline
Member
 
Join Date: Dec 2008
Location: England
Posts: 25
Maybe something along the lines of:

Code:
diffInZ = 3.0 # Value to add/subtract to Z position of selected ball

def onMouseWheel(dir):

    global ball # Same ball object selected from previous mouse move callback

        # Check 'ball' is valid/one selected from previous callback
               ballPos = ball.getPosition()
               addZ = -3.0            
        
               # If wheel is moving forward, make positive, else leave as negative
               if dir > 0:
                 addZ = 3.0
            
            ball.setPosition( ballPos[0], ballPos[1], ballPos[2] + addZ )

viz.callback(viz.MOUSEWHEEL_EVENT,onMouseWheel)
__________________
Software Developer
Virtalis Ltd.
www.virtalis.com
Reply With Quote