WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
  #1  
Old 04-08-2008, 02:19 PM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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.
Reply With Quote
  #2  
Old 04-08-2008, 02:23 PM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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?
Reply With Quote
  #3  
Old 04-08-2008, 05:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
This is a side effect with the way Vizard 2.5 ran scripts. You can ignore it as long as it runs fine.
Reply With Quote
  #4  
Old 04-09-2008, 09:56 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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???
Reply With Quote
  #5  
Old 04-09-2008, 11:29 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I don't understand what you are trying to accomplish. How are you relating a persons height to screen coordinates?
Reply With Quote
  #6  
Old 04-09-2008, 02:08 PM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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?
Reply With Quote
  #7  
Old 04-09-2008, 05:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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?
Reply With Quote
  #8  
Old 04-10-2008, 06:18 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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.
Reply With Quote
  #9  
Old 04-10-2008, 09:48 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
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.
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 05:21 AM.


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