View Full Version : Triangle Stripping question!

01-17-2003, 09:31 AM
Alright, im currently working on my triangle stripping program... my problem is as follows: I find 2 triangles that touch on side x (x=1,2,or 3)... when i put them into an array... how do i know what verticies to put in?
Like, i know i can ditch some of them... but which ones do i need to keep to draw the triangles correctly...
Thanks in advance!
Dan Sherman

01-17-2003, 11:04 AM
You start by using all three points of the first triangle, start with the point NOT attached to the other poly, then using one of the points attached to the side of the other poly (not sure which this is the tricky part) you test to see what way the winding ends up, when you add the forth point. If the winding is incorrect, you use the other, and so on, however this wont always work. Tri strips are very difficult to get right, with as few strips as possible. I personaly just use indexed vertex arrays, and this seems to give fast enought results for me.

01-18-2003, 02:57 AM
so basically trial and error?
Alright, thanks man =P

01-18-2003, 02:48 PM
i got a perfect stripper :-P
selfmade :-P
better results are impossible mine is the best wuahhah
(is now version 2.0 takes about 5 minutes for 4000 triangles but tries EVERYTHING to get the best strips...even draw-order-changing : 0-1-2 1-2-0 and 2-0-1)

01-19-2003, 04:27 AM
is it standalone? (if so, what kinda files does it load)?
or is it a library?

01-19-2003, 10:57 PM
it's coded in java, so its a class.

it converts an array of singlepolygon-instances (singlepolygon is a class holding a polygon (which consists of an array of vertex-objects (another class) allowing a lot of stuff, such as collision checking with another polygon, a box, a sphere etc., normal calculation bla bla...)

if you give an array to my stripper-class it builds a new object, which is an instance of my class called strip, which can draw the strip by using glvertex3f-commands, and holds a simple float-array that can be used as an vertex array for drawing the strip...

so i think thats useless for you. but i can post the source of the stripper, which is easy to port to c++

01-20-2003, 06:56 AM

I'm interested in seeing this code. Could you share it?