L.Q is nearly never zero, that makes much sence.. think about it.. inprecice floatingpoint values of vectors, how big is the chance that they point into exactly the same direction? not really big..
still the chance is there. but, as i said, nearly zero
"take a look around" - limp bizkit
www.google.com
3D & 4D Vector Math
quote:Well i'm trying to use a ray tracing algoritm to test if a ray intersects an arbitry plane that a triangle lies in. In my book it says that if the plane vector L dot product with the ray endpoint Q
L.Q = 0 then no intersection occurs.
The problem is that L.Q never seems to equal zero even when i ,ake sure that no intersection will take place.
Think of it this way. Let's say your ray starts out on the positive side of the plane, and that it is going to intersect the plane. As you increase your time steps and check the point, L.Q will remain positive for a while, but slowly decrease. Now, at one time step, it might be a positive number, but all of a sudden, at the next timestep, it's a negative number. This means that the ray HAD to pass through the plane between those two timesteps.
It won't ever exactly be zero, but you can use the sign of the last dot product to determine if the side changed which indicates collision. To determine the actually intersection point, you'll need to use some vector math. It involves using similar triangles
[edited by - Zipster on December 8, 2002 2:31:37 PM]
Another problem i can forsee here is that a ray is considered to be infinite and therefore when i test to see if the ray intersects any of my models triangles i only want the ray to be a small distance long (the distance the player moves in one pass) how can i alter my calculations to make my ray a set distance in length?
ray(t) = origin + t*direction
if you have an intersection, you have the t for it. check if t is in the range you want it to be..
"take a look around" - limp bizkit
www.google.com
if you have an intersection, you have the t for it. check if t is in the range you want it to be..
"take a look around" - limp bizkit
www.google.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement