Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Crow-knee

Creating triangles from line strips

This topic is 5276 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I have written a rudimentary .dxf converter (to DX), and have come to the problem of taking my line strips and creating triangles for rendering in DX. I have had a quick look around for tripling algorithms but I haven''t found anything which I can use (most google results telling me that wonderful products can triple for me!). Could someone please help me out - provide some other key-words to search on. Thanks, Steele.

Share this post


Link to post
Share on other sites
Advertisement
Ok, I have come along a bit with this so I can be a bit more specific. The part I am having trouble with is, given a particular line, how to determine which side of the line is "inside" the polygon.

C
+--+ +------+
| | | |
| A+--+B |
| |
| +--+ +--+
| | | |
+---+ +--+


So that working around my line strip in clockwise order (this is arbitrary) from A to B, how can I tell that the triangle ABC is not within the polygon?
Thanks for any help,
Steele.

[edited by - Crow-knee on February 9, 2004 7:03:46 PM]

Share this post


Link to post
Share on other sites
Your problem is linked to the convexity of your object.
Look for tesselation of concave polygon on google.

For your particular question, test if B is back facing or front facing segment [AC].
- in 2d this should be testing the sign of the line equation applied on B : a*xB + b*yB +c (I dont remember how to compute a, b & c coeffs).
- in 3d, the same with the plane equation : a*xB + b*yB + c*zB + d, where a,b,c are the coordinates of the normal vector, d can be found with one point of the plane

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!