PDA

View Full Version : optimisating triangles drawing



ybenaabud
03-01-2004, 07:03 AM
Hi everybody,
I have a compicated algorithm that gives me lot of triangles (3D scene)... the problem is that some times it gives me 6 points for a rectangle... and we know that I need only 4 points (using glBegin(GL_TRIANGLE_STRIP)) so how can I do to reoganise my points (triangle) to have minimum points possible (for better performance and less momory)

think you

chemdog
03-02-2004, 06:00 PM
Partition your trinagles into co-planar sets. Within each set, combine shapes, convert trinagles to general polygons, by recursively removing adjacent edges. Apply a minimal triangulation to each polygon.

For help on any step, see a Computation Geometry book. (Or post back questions here.)

Obli
03-17-2004, 09:38 AM
Originally posted by ybenaabud:
...the problem is that some times it gives me 6 points for a rectangle...
How much often does this happen? I wouldn't mind it unless you're wasting more than 1kTri and you're geometry limited.
Before starting on this, are you sure this optimization will pay off in the short run? In the long run?
By the way, how did you realize that and why? Sometimes it's right to have vertices when they're not supposed to be.