PDA

View Full Version : Algorithm for building shapes with TRIANGLE_STRIP



mobilevisuals
04-20-2011, 01:19 AM
I am looking for a good way to triangulate for building shapes with GL_TRIANGLE_STRIP. I made a working algorith and working code for building 3D shapes a few years ago. This has worked on M3G, Java3D and Symbian Open GL C++. It does for some reason not work like it should on Android Open GL. The shapes that I try to build do not look like they should here.

I am calculating the points to the 3d shapes from mathematical
formulas, but I need to find a better way to triangulate these points, so I can build the 3d shapes. Does anyone know a good algorithm for this or maybe some code that I can use for Android?

mhagain
04-20-2011, 02:24 AM
First thing you should do is read this: http://home.comcast.net/~tom_forsyth/blog.wiki.html#Strippers
Then this may also be relevant: http://tomsdxfaq.blogspot.com/2005_12_01_archive.html#113546436585770597#1135464 36585770597

Now, there may still be valid reasons for using strips in 2011; you may be explicitly targetting older hardware or weird/funky hardware where you have profiled and determined that strips are the definitive way to go. But otherwise you'll get much better mileage out of just using GL_TRIANGLES with indexes, and save quite a lot of time and headache too.

Dark Photon
04-20-2011, 04:59 AM
First thing you should do is read this: http://home.comcast.net/~tom_forsyth/blog.wiki.html#Strippers
Then this may also be relevant: http://tomsdxfaq.blogspot.com/2005_12_01_archive.html#113546436585770597#1135464 36585770597

Also:

http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html

mobilevisuals
04-24-2011, 02:00 AM
I see, but is it the same for Android? It seems like almost everybody is using GL_TRIANGLE_STRIP here.