WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-10-2015, 01:40 PM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
help with mouse as tracker position

Hello everyone,

I'm using a trackball mouse for navigation and i want that the mouse will act as a tracker position in order to link it to the main view (to set the point of view of the user according to the mouse). I need to get the x and z coordinates of the mouse constantly while maintaining the y coordinate fixed to 1.8. The reason for using a tracker is because i want to initiate different starting position with randint methode.
I saw an explanation about vizconnent but i didn't understand exacly how to use it and i'm not sure it can resolve my problem.

Thanks in advance and have a nice week.
Reply With Quote
  #2  
Old 11-10-2015, 03:33 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could get the mouse position every frame using viz.mouse.getPosition() and multiply the values returned by some scale factor to simulate position data.
Reply With Quote
  #3  
Old 11-15-2015, 12:37 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
Thanks for your help but i also need a function similar to getPosition that will give me an information about the z coordinate of the mouse so i don't understand how does the getPoition methode can solve my problem.
I found in vizconnect a tracker "mouse speen wheel" but according to the information provided by the vizconnect the x coordinate is replaced by the x coordinate. Is there any tracker in vizconnect or another methode in viz.mouse that can give x,y,z coordinates?
Reply With Quote
  #4  
Old 11-15-2015, 12:56 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
Thanks Jeff but the getPosition methode provide information about the x&y coordinates but not on the z coordinate. Is there any methode or tracker that provide information of x&y&z coordinates?
Reply With Quote
  #5  
Old 11-16-2015, 03:32 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The ScrollWheel tracker included with the vizconnect library returns Z position data. This could be combined with the X and Y data returned from the viz.mouse.getPosition() function:

Code:
import viz
import vizact
viz.go()

from vizconnect.util.virtual_trackers import ScrollWheel
mouseTracker = ScrollWheel(scaleVelocityWithDistance=True, extensionAccel=100, debug=False)

def printData():
	print mouseTracker.getPosition()

vizact.ontimer(1,printData)
Reply With Quote
Reply


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 javadi Vizard 2 11-19-2013 03:59 AM
get tracker position and euler chris_user Vizard 2 07-01-2011 01:31 AM
Mouse event: how to detect no mouse move event, how to set mouse position? Zhi Vizard 3 04-11-2011 06:25 PM
set mouse position AlyssaK Vizard 1 01-28-2009 04:05 PM
Can you link the position of a tracker to the orientation of an object? michaelrepucci Vizard 1 09-19-2008 10:23 AM


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


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