Archived

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

Triangles clipped become un-triangles....

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

Recommended Posts

Hi, I have a problem. My software renderer is currently drawing triangles. This is not a problem until they are clipped against the Z plane, as then the will become quads, and I can''t render quads. I hear that you can split the quad into triangles, but I also heard this is hard and complex. Speed is also an important issue- would it be quicker/easier to render convex polys rather than just triangles? I used to do this, but since using the triangle filler things have become slightly faster... and this is a speed increase I really need. Cheers, -Paul

Share on other sites
Depending on how you are doing cliping.... If you know which polys are both on and off screen, test them to see if they will be quads or tris (If one point off screen, two on, then quad, otherwise tri.)
calculate the intersection of the sides of the tri and the screen, which will give you two points.
If quad, you then split into two tris by taking one of the intersection points and the point of the original triangle that was not on the edge that you took the intersection point from.
The points of the two new tris are these two points, and one of other points.

Hopefully that made sense... I''m not sure if it''s the fastest way, but it would work. If texturing the poly''s you''d have to worry about lining up the texture right after the split though, but you''d have to do that anyways.

Hope that helped.

Share on other sites
Splitting into tris shouldn''t be too hard. I assume you have your verteces in some order, like clickwise, already. In that case, if you have quad ABCD, then you just make tris ABD and BCD.

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• Forum Statistics

• Total Topics
632993
• Total Posts
3009759
• Who's Online (See full list)

There are no registered users currently online

×