OpenGL Shape Demo
The OpenGL Shape Demo is intended to act as a sandbox for learning how
the 10 OpenGL shape modes work. Refer to the following picture and
text below for a more detailed discussion:
- points: shows a point at each vertex in Draw Area. Useful for incomplete shapes and for moving vertices.
- lines: draws a line through vertices in Draw Area in the order they were placed there
- Enable Culling: turns on face removal in default mode - removes "backward" facing triangles regardless of primitive type.
See also Front Face.
- Polygon Mode: select between point, line and filled polygon drawing styles.
Note: GL_FILLED is the default.
- Front Face: Select
between two different ways of determining whether a triangle is facing
forward or backward. the orientation of a triangle is determined by the
relative ordering of its three points, ie. ClockWise (GL_CW) or
Note: GL_CCW is the default
You can dump the coordinates of what you draw in the Draw Area
The coordinates are in normalized
This means that that x and y values are scaled to lie in the range
[0,1]. You will wish to scale the points to the size of your intended
drawing target. To do this you should apply the following equations to
x_scaled = target_x_min + (x_norm * target_width)
y_scaled = target_y_min + (y_norm * target_height)