View Single Post
Old 05-24-2009, 12:56 AM
Chrissy2009 Chrissy2009 is offline
Join Date: May 2009
Posts: 33
Draw Vector in viewpoint lookat direction


I want to draw a line from one object in a special direction for a given amount.

The amount (or the length) is from a slider and that works fine!

But the direction of the line should be the viewpoint lookat direction.

So for example my viewpoint is behind of a ball and now I want to draw a line to see how the ball will roll.

I use:

current = balls[0].get(viz.POSITION)
vector = balls[0].get(viz.LOOK)
future = vizmat.MoveAlongVector(current, vector, slider.get()*2)
hit = viz.intersect(current, future)
rod = viz.endlayer()
But this doesn't work. :-(

Can anybody help me?

And additionally it would be very great if the vector will be changed depending on a change of the viewpoint. If I turn the viewpoint left or right, the vector will be drawn in the corresponding direction.
Reply With Quote