Thread: viz.look
View Single Post
  #1  
Old 06-19-2006, 01:51 PM
paulpars paulpars is offline
Member
 
Join Date: May 2006
Location: Kingston, Ontario
Posts: 14
viz.look

i am confused as to how this works, and i can't find any documentation for it either...i am trying to create a vector out the front of the car i am driving in but the vector always goes out the back even when i'm driving forward... here's what my code looks like:

Code:
		#Get the car's current position.
		current = car.get(viz.POSITION)
		#Get the vector for the direction in which the car is positioned.
		vector = car.get(viz.LOOK)
		#Find the car's future position if it travels along the vector 30 meters.
		future = vizmat.MoveAlongVector(current, vector,30)
		#Draw a line between the current and future positions and 
		#see if it intersects anything.
		hit = viz.intersect(current, future)
		viz.startlayer(viz.LINE_LOOP)
		viz.vertexcolor(viz.RED)
		viz.vertex(current)
		viz.vertex(future)
		line = viz.endlayer()

thanks
Reply With Quote