Contents / Previous / Next


Points

A point is not a pixel. Difference arises from the limitations of a bitmapped graphics display. On a display, the smallest displayable unit is a pixel, and although pixels might be less than 1/100th of an inch wide, they are still much larger than the mathematician's infinitely small (for points) or infinitely thin (for lines).

When OpenGL performs calculations, it assumes points are represented as vectors of floating-point numbers called a vertex.
However, a point is typically (but not always) drawn as a single pixel, and many different points with slightly different coordinates could be drawn by OpenGL on the same pixel.

GL code to draw 2D-integer points looks like this:

gl.glBegin (GL.GL_POINTS);
	gl.glVertex2i (3,5);
	gl.glVertex2i (0,7);
gl.glEnd ();
One important fact to be aware of is that in OpenGL (and thus JOGL), the origin point (0,0) is at the bottom left, instead of the top left, as in AWT.

GL code to draw 3D-float points is:

gl.glBegin (GL.GL_POINTS);
        gl.glVertex3f( 0.25f,  0.25f, 0);
        gl.glVertex3f( 0.25f, -0.25f, 0);
gl.glEnd ();