WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-06-2007, 10:09 AM
Jerry Jerry is offline
Join Date: Jun 2004
Posts: 105
What a drag?

What is viz.drag() supposed to do? When I run

duck = viz.add('duck.wrl')

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?
Reply With Quote
Old 02-06-2007, 10:10 AM
Jerry Jerry is offline
Join Date: Jun 2004
Posts: 105
I meant viz.grab()
Reply With Quote
Old 02-06-2007, 10:19 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The viz.grab() command is not meant to be used for dragging objects with the mouse. Look at the 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.
Reply With Quote
Old 02-07-2007, 09:07 AM
Gladsomebeast Gladsomebeast is offline
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
viz.grab() with the mouse makes sense if the object you are grabbing is on the screen.

import viz

screenText = viz.addText('GrabME', viz.SCREEN)
s = 1
screenText.setPosition(.5, .5)

grabLink = None

def onMouseDown(button):
	global grabLink
	if grabLink:
		#in case we missed mouse up event
	grabLink = viz.grab( viz.Mouse, screenText )


def onMouseUp(button):
	global grabLink
	grabLink = None

Paul Elliott
WorldViz LLC
Reply With Quote

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

All times are GMT -7. The time now is 11:37 AM.

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