#1
|
|||
|
|||
What a drag?
What is viz.drag() supposed to do? When I run
duck = viz.add('duck.wrl') duck.translate(0,1.5,4) viz.grab(viz.Mouse,duck) the duck moves with the mouse but doesn't stay under the cursor as one might expect if it were being dragged. PS - Is Vizard compatible with Vista? |
#2
|
|||
|
|||
I meant viz.grab()
|
#3
|
|||
|
|||
The viz.grab() command is not meant to be used for dragging objects with the mouse. Look at the tutorial_grab.py script in the [Vizard30]\tutorial\link directory for an example. It's mostly used when you are doing some sort of hand tracking and you want to simulate grabbing an object.
|
#4
|
|||
|
|||
viz.grab() with the mouse makes sense if the object you are grabbing is on the screen.
Code:
import viz viz.go() screenText = viz.addText('GrabME', viz.SCREEN) s = 1 screenText.scale(s,s,s) screenText.setPosition(.5, .5) grabLink = None def onMouseDown(button): global grabLink if grabLink: #in case we missed mouse up event grabLink.remove() grabLink = viz.grab( viz.Mouse, screenText ) viz.callback(viz.MOUSEDOWN_EVENT,onMouseDown) def onMouseUp(button): global grabLink grabLink.remove() grabLink = None viz.callback(viz.MOUSEUP_EVENT,onMouseUp)
__________________
Paul Elliott WorldViz LLC |
|
|