WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-17-2005, 12:47 PM
nickyee nickyee is offline
Member
 
Join Date: Jun 2004
Location: Stanford, CA
Posts: 19
Constraining Height

For an upcoming study, I'd like to constrain the height of the subject while still rendering the relative y-position of the subject from thier starting point.

I understand that it would be trivial to simply not render the y-position and set the eyeheight to be constant, but is there a way to:

1) set eye-height at reset
2) subsequent y-position movement is rendered relative to this starting point

In other words, I can set a subject to be 1 meter or 2 meters tall, but if they crouch down or tip-toe, they can still get taller or shorter relative to their starting heights.

What's the easiest way of doing this?
Reply With Quote
  #2  
Old 01-17-2005, 01:05 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
You can apply an offset to the PPT tracking data. Look here for how to use command 7:

http://www.worldviz.com/vizhelp/VizH...er_plug-in.htm

What you'd want to do is reset your tracker, read the user's actual height, calculate the difference between his/her height and your desired virtual height, and then apply that difference as an offset.
Reply With Quote
  #3  
Old 01-17-2005, 02:06 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Have you tried using the viz.eyeheight command? If I'm not mistaken this should do what you are wanting. For example, if you wanted to constrain the users height to 1 meter you would do:
Code:
viz.eyeheight(1)
Then to initialize the user you would issue a reset command to the tracking sensor you are using (i.e PPT):
Code:
ppt.reset()
Reply With Quote
  #4  
Old 01-17-2005, 06:57 PM
nickyee nickyee is offline
Member
 
Join Date: Jun 2004
Location: Stanford, CA
Posts: 19
I've tried both those solutions, but they both seem to be setting a base point and then adding the y-position on top of it.

So if you set viz.eyeheight(1) and I am 1.7m tall, it shows me at 2.7. And if someone is 1m tall, it will show them at 2m.

Neither seems to be able to set a height independent of the user's height.

I've tried:

if key == 'r':
headIsense.reset()
ppt.reset()
viz.eyeheight(1)

and

if key == 'r':
headIsense.reset()
ppt.reset()
selfpos = viz.get(viz.HEAD_POS)
selfy = selfpos[1]
adjust = 1.0 - selfy
ppt.command(7,"",0,adjust,0)

Am I doing something wrong?

Last edited by nickyee; 01-17-2005 at 07:02 PM.
Reply With Quote
  #5  
Old 01-18-2005, 11:20 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Try issuing the following command after you add the ppt sensor:
Code:
ppt.command(6,'',1,1,1)
Reply With Quote
  #6  
Old 01-18-2005, 02:32 PM
nickyee nickyee is offline
Member
 
Join Date: Jun 2004
Location: Stanford, CA
Posts: 19
Cool - that worked. In case anyone else has the same problem, this is the code I used.

PHP Code:

if tracking:
    
headIsense viz.add('intersense.dls')
    
ppt viz.add('vizppt.dls')
    
#Average over 5 samples
    
ppt.command(5,'',5)
    
#Automatically track head position and orientation
    
viz.tracker()
    
#Add an intersense for body orientation
    
bodyIsense viz.add('intersense.dls')
    
ppt.command(6,'',1,1,1
Then for the reset button:

PHP Code:
    if key == 'r':
        
headIsense.reset()
        
ppt.reset()
        
        if 
HEIGHT_COND == 'tall':
            
viz.eyeheight(HEIGHT_BASE HEIGHT_DIFF)
        
elif HEIGHT_COND == 'short':
            
viz.eyeheight(HEIGHT_BASE HEIGHT_DIFF)
        else:
            
viz.eyeheight(HEIGHT_BASE
Reply With Quote
  #7  
Old 01-18-2005, 02:37 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Great, and thanks final solution.
Reply With Quote
  #8  
Old 01-18-2005, 02:46 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Just to be clear, you only need to set the eyeheight at the beginning of the script. You don't have to keep setting it every time you reset the sensor, unless you are changing the value of the eyeheight during each reset.
Reply With Quote
Reply

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 03:50 AM.


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