WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-28-2004, 04:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

To get information about the viewer use the viz.get() command. Take a look in the command reference of the documentation for a more detailed description. Here's an example:
Code:
#Get the head position
pos = viz.get(viz.HEAD_POS)

#Get the yaw of the viewer
#Note: yaw refers to rotation about the Y-axis
yaw = viz.get(viz.VIEW_YAW)
Take a look at the duckcourt example in the tutorial folder for using crosshairs. Here's the basic idea:
Code:
import viz
viz.go()

#Add a texture quad to the screen
crosshair = viz.add(viz.TEXQUAD,viz.SCREEN)

#Apply your crosshair texture to the quad
#Make sure you have an image file with transparency
crosshair.texture(viz.add('crosshair.png'))

#Turn off the mouse cursor
viz.cursor(0)

def mytimer(num):
	#Update the crosshair position
	crosshair.translate(viz.mousepos()+[0])

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.01,viz.FOREVER)
Good luck!
Reply With Quote
 


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 09:51 AM.


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