I want to paint a hex map with each hex a (potentially) different color. The shared border is black and the interior is a solid color. If I want to paint a 1920x1080 display, how can I do this the fastest way with OpenGL?
See the image below for a sample hex (blown up for clarity). The color of the hex won't necessaril开发者_C百科y be the same as any of the surrounding hexes.
A TRIANGLE_FAN
would work quite well, since a hex is convex.
Fill the entire area with the border color, then render each hex as a TRIANGLE_FAN
leaving a gap between adjacent hexes where the border color can show through.
精彩评论