LWJGL Forum

Programming => OpenGL => Topic started by: Fool Running on August 24, 2007, 19:27:30

Title: Using triangle fan for multiple columns
Post by: Fool Running on August 24, 2007, 19:27:30
I know that triangle fans are much more efficient then drawing individual triangles...
I'm drawing triangles that are laid out like:
-----------
|   /|   /|
|1 / |5 / |
| /  | /  |
|/ 2 |/ 6 |
-----------
|   /|   /|
|3 / |7 / |
| /  | /  |
|/ 4 |/ 8 |
-----------

I can't figure out how to draw the second column (starting with triangle 5) without starting a new triangle strip. This means that I can't store them in a VBO or in an element array for faster drawing.
I assume I'm missing how to do this (although I've looked at many tutorials ::) ) and need some help ;D
Title: Re: Using triangle fan for multiple columns
Post by: Matthias on August 24, 2007, 20:34:11
Well - they used to be much more efficient. It's better to use indexed triangles and optimize their order.
See http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html (http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html)

It's much more efficient to reduce the number of draw calls. But then you could also use degenerates to stitch them together.

Ciao Matthias
Title: Re: Using triangle fan for multiple columns
Post by: Fool Running on August 30, 2007, 16:31:18
Guess I need to get newer OpenGL books :-\

Thanks ;D