# Triangle Stripping question!

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…
Dan Sherman

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.

so basically trial and error?
Alright, thanks man =P

i got a perfect stripper
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)

is it standalone? (if so, what kinda files does it load)?
or is it a library?

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++

Hi,

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

Thanks.