WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-21-2010, 11:53 AM
Philippe Philippe is offline
Member
 
Join Date: Jul 2010
Posts: 12
limiting object rotation

Hi,

Is there a method enabling to limit the range of rotation of a tracking device (Euler) relatively to the orientation of another tracking device (in my case, I have a gun which orientation's follows the glove position, and I would like to limit the orientation of the gun so that it cannot point backwards but only forwards - i.e. limiting the yaw of the gun to a range from -90 degrees to +90 degrees relatively to the current direction of the HMD).

Is there a simple way to do this?
In order words, I would like not to enable the gun to point backwards (this is some workaround solution: due to some tracking issues, it happens that the gun suddenly "flips back" and stays pointing backwards even when the glove stays more or less in the north direction ; I would like to have the glove never identified as pointing south).

Thanks,
Philippe.
__________________
Thanks,

Philippe
Reply With Quote
  #2  
Old 09-21-2010, 02:30 PM
Chapre Chapre is offline
Member
 
Join Date: Sep 2010
Posts: 36
You could reset the yaw to 90 degrees or -90 degrees everytime the gun try to go beyond the limit.
Ex:
rho=gun.getEuler()
if 90 < rho[0] < 180:
---> rho[0]=90
elif -180 < rho[0] < -90:
---> rho[0]=-90
gun.setEuler(rho)

Last edited by Chapre; 09-21-2010 at 02:36 PM.
Reply With Quote
  #3  
Old 10-07-2010, 12:40 PM
Philippe Philippe is offline
Member
 
Join Date: Jul 2010
Posts: 12
Thanks a lot !
__________________
Thanks,

Philippe
Reply With Quote
  #4  
Old 10-07-2010, 12:51 PM
Philippe Philippe is offline
Member
 
Join Date: Jul 2010
Posts: 12
But where should I put such a code in the viztracker file? I would like to have this check permanently running - should I put it in the _addTracker() method ?
__________________
Thanks,

Philippe
Reply With Quote
  #5  
Old 10-07-2010, 01:07 PM
Philippe Philippe is offline
Member
 
Join Date: Jul 2010
Posts: 12
Actually, I think that the best way is to use:

def udpateGunPosition():
(the code)

and then use

vizact.ontimer(0,udpateGunPosition)

in the main program.
This should do the job, right?
__________________
Thanks,

Philippe

Last edited by Philippe; 10-07-2010 at 01:12 PM.
Reply With Quote
  #6  
Old 10-07-2010, 04:31 PM
masaki masaki is offline
Member
 
Join Date: Jan 2008
Posts: 63
Hi,

Can you attach your script and I can take a look.

Thanks,
Masaki
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
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
Unable to perform 360 rotation using vizact.spinto vijaykiran Vizard 2 09-29-2009 08:39 AM
Object rotation Andrey Vizard 4 06-13-2007 02:49 PM
Child Object Rotation paulgoldberg Vizard 5 09-05-2006 11:33 AM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM


All times are GMT -7. The time now is 05:37 PM.


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