Is Ray Casting What I'm lookin' for here?
I had a previous post about Quadtrees and stuff and dividing the polygons into nodes. I have starting learning about planes and stuff but I have no idea as to how to detect the coordinates of where the plane intersects the triangle. This is so that I can therefore construct 2 triangles from one with the new vertice if the triangle spans the 2 nodes. Should I be learning ray casting for this or what, I don''t really have a clue.
Thanks
February 09, 2002 09:53 AM
No, raycasting is something else. Raycasting is a simplified 2D version of raytracing. It''s used to get per vertex effects, such as reflection, shadows, refraction, etc.
What you need is simple polygon splitting. If you want to split a triangle between 2 nodes, then that is essentially clipping, but you keep both parts, instead of throwing 1 part away (as with clipping). A triangle divided by a plane splits normally into 3 triangle, or into 2 in the special case of the plane going through one of it''s vertices. Just calculate the intersection points between the triangles edge segements and the plane. That will create 2 intersection points, forming a line. Now divide your triangle along this line. You will get one triangle and one quad for the general case. Split the quad into 2 triangles, and you are done.
Your should look into Sutherland-Hodgeman or Cohen-Sutherland clipping algorithms.
What you need is simple polygon splitting. If you want to split a triangle between 2 nodes, then that is essentially clipping, but you keep both parts, instead of throwing 1 part away (as with clipping). A triangle divided by a plane splits normally into 3 triangle, or into 2 in the special case of the plane going through one of it''s vertices. Just calculate the intersection points between the triangles edge segements and the plane. That will create 2 intersection points, forming a line. Now divide your triangle along this line. You will get one triangle and one quad for the general case. Split the quad into 2 triangles, and you are done.
Your should look into Sutherland-Hodgeman or Cohen-Sutherland clipping algorithms.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement