WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Laser Pointer Updated (https://forum.worldviz.com/showthread.php?t=1438)

Elittdogg 04-08-2008 02:19 PM

Laser Pointer Updated
 
Code:

import viz       
viz.go()

Height = viz.input('Height?')
print "Participant's height is", Height, "inches."

Meters = (Height * (1.0/39.37))
print "Participant's height is", Meters, "meters."

RedDot = viz.add(viz.TEXT3D, '.', viz.SCREEN)
RedDot.translate(0.5, 0.57, 0)
RedDot.alignment(viz.TEXT_CENTER_CENTER)
RedDot.color(1,0,0)        # Red
#RedDot.scale(.5, .5, .5)


Ok...so here's my "deal." The RedDotis supposed to mimic the laser pointer (which is going to be positioned on top of a person's head. So I was trying to come up with a way to input how tall the person is, convert it to meters (if necessary), and then use that height to position the RedDot. So instead of

RedDot.translate(0.5, 0.57, 0)

I want: RedDot.translate(0.5, Meters, 0)

That way I can customize the height of the laser pointer in Vizard to each individual's personal height.

Elittdogg 04-08-2008 02:23 PM

Also, do you know why this line:

Meters = (Height * (1.0/39.37))

keeps getting highlighted yellow without giving me an error message every time I run the script? Is something wrong with it?

farshizzo 04-08-2008 05:21 PM

This is a side effect with the way Vizard 2.5 ran scripts. You can ignore it as long as it runs fine.

Elittdogg 04-09-2008 09:56 AM

Thank you. It runs fine so I have been ignoring it. But my original question still stands...how can I get it so that the laser pointer is set to the height of the participant???

farshizzo 04-09-2008 11:29 AM

I don't understand what you are trying to accomplish. How are you relating a persons height to screen coordinates?

Elittdogg 04-09-2008 02:08 PM

I'm trying to mimic a real setting where a laser pointer would be fixed on top of a person's head and therefore the "height" or the "coordinates" of the laser would chance from participant to participant. I'm looking for a way to be able to enter the participant's height and then use that input to determine where the laser pointer in Vizard should be.

Does that make more sense?

farshizzo 04-09-2008 05:21 PM

Sorry, I'm still having trouble understanding why you need to know the participants height. If the laser is attached to the head then its position will always be the same relative to the viewpoint, regardless of the persons height. Am I correct in assuming that your participants will be wearing HMDs?

Elittdogg 04-10-2008 06:18 AM

Yes that is correct. They will be wearing HMDs. Here's where I'm getting tripped up (and maybe this is irrelevant):

RedDot = viz.add(viz.TEXT3D, '.', viz.SCREEN)
RedDot.translate(0.5, 0.57, 0)
RedDot.alignment(viz.TEXT_CENTER_CENTER)
RedDot.color(1,0,0) # Red
#RedDot.scale(.5, .5, .5)

The RedDot.translate part of the above code sets the dot on the screen at a "height" of 0.57. And that's going to be fixed for everyone I assume. So while their individual viewpoints will rotate according to their own movement the dot will stay at that "level."

So for my maze the red dot (with the 0.57 translation in effect) is right in the center of the screen/viewpoint (which is good) and about 3/4 of the way up the screen (which was my best guess for an average height person).

Since I'm trying to mimic a real setting (with this red dot) in which a laser pointer will be fixed to a person's head I want to be able to allow for the red dot to appear at different "heights" depending on if the person is 6 feet tall or 5 feet tall etc etc. Because in the physical setting the 5" person's laser pointer will be (let's say) 45% up from the bottom of the maze whereas the 6" person's will be 75% up from the bottom of the maze (I just made up numbers ).

So as it stands right now I'm creating this red dot texture on the screen and it will always stay in that fixed point. It will appear to move when the person's viewpoint moves. But it will always be 0.57 translated in the Y direction and thus won't allow for discrepancies in height.

Does that make more sense? Am I still not be clear? Sorry, I'm having a hard time explaining this.

Elittdogg 04-10-2008 09:48 AM

Nevermind. I realized I was being an idiot. I understand your confusion because I didn't know what I was talking about. Thanks for the help.


All times are GMT -7. The time now is 08:32 AM.

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