WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Constraining Height (https://forum.worldviz.com/showthread.php?t=276)

nickyee 01-17-2005 11:47 AM

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?

tobin 01-17-2005 12:05 PM

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.

farshizzo 01-17-2005 01:06 PM

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()

nickyee 01-17-2005 05:57 PM

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?

farshizzo 01-18-2005 10:20 AM

Hi,

Try issuing the following command after you add the ppt sensor:
Code:

ppt.command(6,'',1,1,1)

nickyee 01-18-2005 01:32 PM

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


tobin 01-18-2005 01:37 PM

Great, and thanks final solution.

farshizzo 01-18-2005 01:46 PM

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.


All times are GMT -7. The time now is 12:26 PM.

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