Hi there!
I’m using ofxDelaunay for a project and i’ve ran into an issue trying to draw the triangles with a solid colour. Currently, the triangles are drawn with a gradient fill as seen below:
I’ve read that it may be down to sharing vertices - Did anybody have any ideas on how to solve this? Some small code examples would help massively!
Thank you ever so much!
James.
Hi James!
If you are still using the Fixed function renderer (not GL Programmable Renderer) you can simply set glShadeModel(GL_FLAT) before drawing.
https://www.opengl.org/discussion_boards/showthread.php/169700-GL_FLAT-GL_SMOOTH-switching-front-and-back-issue
If you are using programmable renderer, you’ll need to write a simple shader that passes the vertex colors along with flat interpolation qualifiers
http://www.geeks3d.com/20130514/opengl-interpolation-qualifiers-glsl-tutorial/
Hope this helps!
1 Like
Thank you so much, this has solved it straight away!
James.
eight
November 12, 2015, 10:41pm
#4
I am curious how you define the points and colors for the points to triangulate.
Thanks.
–8