WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-02-2006, 01:59 PM
enkeli enkeli is offline
Member
 
Join Date: Mar 2006
Location: Isla Vista
Posts: 24
Track Eye Gaze with Lines

I am trying to add lines (aka: "rays", whatever you want to call them) to indicate where an avatar is looking. So ideally the line originates at the avatar's head and extends out according to their gaze. This is what I'm using to create the lines:

Code:
		[ x, y, z ] = avatar.getpos()
		y = 1.4
		viz.startlayer( viz.LINES )
		viz.linewidth( 1 )
		gazeOrigin = viz.vertex( x, y, z ) 
		gazeEnd = viz.vertex( x, y, z + 5 ) 
		gaze = viz.endlayer()
		gaze.color( viz.BLUE )
		gaze.alpha( 0.3 )
Easy enough, but now I want to update where the line is pointing when the avatar moves their head. I want to keep the origin vertex stationary while changing the angle of the line. Suggestions?
Reply With Quote
  #2  
Old 05-02-2006, 02:06 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Just change the position of the second vertex:
Code:
gaze.vertex(1,x,y,z)
If you are going to be changing the vertex frequently then add the following line of code after you create the gaze line:
Code:
gaze.dynamic()
This will speed up rendering.
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 01:50 PM.


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