|
#1
|
|||
|
|||
output data to screen
Hi,
I'm writing the position of the joystick data to a file and I want the same information to appear on the top left of the vizard screen so that the user can see it. However I'm moving down an infinite road which is constantly updating and therefore my joystick information has to also move along with that, so I guess that I have to assign the text as a child of the road (or ground). This is what I've come up with so far Code:
file = open( 'speed_.txt' + str(subject),'w' ) def mytimer (num): joy_pos = str(joy.getPosition()) out = str(joy_pos + '\n') file.write(out) file.flush() print out #Add text as child of road speed = viz.add(viz.TEXT3D,joy_pos, road) speed.alignment(viz.TEXT_LEFT_TOP) #Text translation will be relative to road local coordinate system speed.translate(-1,1,-1) speed.color(0,0,0) speed.scale(.2, .2, 2) viz.callback( viz.TIMER_EVENT, mytimer ) viz.starttimer( 0, 0.25, viz.FOREVER ) Any help would be great! |
#2
|
|||
|
|||
if you use viz.SCREEN the text will be fixed on the screen
Code:
import viz viz.go() #Add text to the screen. text_2D = viz.addText( 'on the screen', viz.SCREEN ) text_2D.setPosition(.05, .9 ) #2D text only needs x and y. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
writing joystick position to a data file | Saz | Vizard | 3 | 12-17-2008 05:18 AM |
position of html-file on screen | active_world | Vizard | 1 | 05-16-2008 07:24 PM |
Flagging the Data | Elittdogg | Vizard | 5 | 04-11-2008 11:40 AM |
text output | jaclyn.bill | Vizard | 2 | 10-24-2007 06:37 AM |
tracking using quaternarion data | jfreeman | Vizard | 2 | 06-01-2005 08:48 AM |