Ray Rectangle intersection

markraz

Full Member
Joined
Feb 19, 2014
Messages
338
Hi this is a ray triangle intersection formula. I think I sort of understand it (thanks cubist).
My question is can this easily be amended to work with a quad/rectangle as opposed to triangle?

Thanks in advance

1615474066345.png
 
Here's a link to the previous thread.

If the quad exists in a plane, then yes, beta and gamma can be calculated and then used to determine if there is an intersection with the quad. BUT USUALLY the quad does not exist in a plane, therefore this technique is (probably) hardly used.

In other words, if the quad has the four vertices a,b,c,f then f is not always in the plane of triangle abc. This is especially true for curvy surfaces. Therefore the quad is often dealt with as being made from two distinct triangles. Intersections would be computed separately for these two triangles.

However quads are often used in 3d modelling in preference to triangles because they subdivide much nicer than triangles (the rendering package can automatically create finer-looking surfaces more easily) and also texture coordinates stretch better across quads than triangles. There may be more advantages than this!
 
Here's a link to the previous thread.

If the quad exists in a plane, then yes, beta and gamma can be calculated and then used to determine if there is an intersection with the quad. BUT USUALLY the quad does not exist in a plane, therefore this technique is (probably) hardly used.

In other words, if the quad has the four vertices a,b,c,f then f is not always in the plane of triangle abc. This is especially true for curvy surfaces. Therefore the quad is often dealt with as being made from two distinct triangles. Intersections would be computed separately for these two triangles.

However quads are often used in 3d modelling in preference to triangles because they subdivide much nicer than triangles (the rendering package can automatically create finer-looking surfaces more easily) and also texture coordinates stretch better across quads than triangles. There may be more advantages than this!
thanks makes sense
 
Top