|
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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? |
#3
|
|||
|
|||
This is a side effect with the way Vizard 2.5 ran scripts. You can ignore it as long as it runs fine.
|
#4
|
|||
|
|||
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???
|
#5
|
|||
|
|||
I don't understand what you are trying to accomplish. How are you relating a persons height to screen coordinates?
|
#6
|
|||
|
|||
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? |
Thread Tools | |
Display Modes | Rate This Thread |
|
|