lasserix
07-04-2012, 03:06 PM
I'm stuck with opengl 1.0 es, since my target is android phones*. However this question regards just triangle fans and colors.
I've generated an array of vertices forming a circular shape, drawing it as a closed triangle fan. I'm not packing my array (will do in the future), so I'm loading my color array separately. My goal is to have a smooth HSV gradient per subsequent triangle of the fan. Which works along the edge; however, towards the center of the triangle fan the color blends to the original color set the first iteration of the loop. So instead of a smooth rainbow per say, each subsequent triangle correctly graduates in color along the edge, but blends to that original color set with the first vertex / origin of the fan.
My question is is there any way to update the color value of the "implicit vertex" (represented by the origin) of each subsequent triangle? Or do I have to use another primitive all together?
If anything is unclear, let me know!
Thanks for any help!
* Android phones support opengles 2.0, however that is near-future work. Also, I'm stuck using only triangle primitives, no quads.
Update:
While not solving the problem above, I used a circular triangle strip, so I could graduate the color of the inner set of vertices. However this makes the vertex buffer at least twice as large, which is undesirable.
I've generated an array of vertices forming a circular shape, drawing it as a closed triangle fan. I'm not packing my array (will do in the future), so I'm loading my color array separately. My goal is to have a smooth HSV gradient per subsequent triangle of the fan. Which works along the edge; however, towards the center of the triangle fan the color blends to the original color set the first iteration of the loop. So instead of a smooth rainbow per say, each subsequent triangle correctly graduates in color along the edge, but blends to that original color set with the first vertex / origin of the fan.
My question is is there any way to update the color value of the "implicit vertex" (represented by the origin) of each subsequent triangle? Or do I have to use another primitive all together?
If anything is unclear, let me know!
Thanks for any help!
* Android phones support opengles 2.0, however that is near-future work. Also, I'm stuck using only triangle primitives, no quads.
Update:
While not solving the problem above, I used a circular triangle strip, so I could graduate the color of the inner set of vertices. However this makes the vertex buffer at least twice as large, which is undesirable.