We create the geometry of the hexagon by selecting six equally spaced points around a circle that is centered at the origin and has a radius of 1. As done with square 2, we obtain the rectangular coordinates from the polar coordinates of the points.

As we done in the function drawSquare2, we use for our texture coordinates the vertex coordinates. We also use the same texture transformations. (see the function drawSquare2).