Red Book Editions, OpenGL Versions

1. First edition, OpenGL 1.0

2. Second edition, OpenGL 1.1

3. Third edition, OpenGL 1.2/1.2.1 *

4. Fourth edition, OpenGL 1.3/1.4

5. Fift edition, OpenGL 1.5/2.0

 

Not sure which OpenGL version you have? Quickly check here. It will tell about

  • JOGL Binding info
  • OpenGL Vendor, Version, Driver info
  • OpenGL Extensions listing

* This is the edition I own.

Difference Between C and Java Examples

  • No render calls from listeners compare to C examples.
  • Some data, especially n-dimensional arrays, requires wrapping in another buffer object or a direct buffer.
  • Swing replaces GLUT's window management API. Also all examples now use GLJPanel
  • All examples file names are preserved in the Java version; except for double.c, which is renamed to doublebuf.java. to resolve name conflict with double keyword.
  • xfont.c, an X Window example, is jfont.java for Java.
  • All color index and NURBS examples are not ported since javax.media.opengl does not support for them.
  • All examples are doubly buffered and all quits on Esc button.
  • All examples quit with shut down hook runExit() button.

WebStart OpenGL Examples

I made Java Web Start (JWS) links for all the programs but you may need to set your "file type association" so your browser will download and deploy programs with JWS file extension (.jnlp). As a convenience, I have archived all the JNLP files along with the sources and classes for the examples so you don't have to individually download each examples. You do need to extract the jnlp folder from that archive to get to the individual jnlp file.

1 Intro to OpenGL

Briefs you on the OpenGL graphics system, as an API, what it does, what it do not; provides a couple of examples to show the sequence of steps for a simple rendition and animation.

simple.jnlp

hello.jnlp 1.1

doublebuf.jnlp

2 State Management and Drawing Geometric Objects

How to draw geometric primitives, the basic of managing states, steps in using vertex arrays.

lines.jnlp

polys.jnlp

varray.jnlp 1.1

mvarray.jnlp 1.4

3 Viewing

Describes the view and modeling, projection, and viewport transformations; working with the matrix stacks, using clipping planes, composing transformations, and reverse transformation.

cube.jnlp

model.jnlp

clip.jnlp

planet.jnlp

robot.jnlp

unproject.jnlp 1.1

 

4 Color

Colors as a 4-tuple RGBA versus color-index, how to draw colored objects, how shading affect a multicolor polygon.

smooth.jnlp

5 Lighting

Describes light models, material colors of objects, how normals affect light on an object, directional lighting, multiple lights, moving light sources.

light.jnlp

movelight.jnlp

material.jnlp

colormat.jnlp

scene.jnlp

 

6 Blending, Antialiasing, and Fog

blendeqn.jnlp 1.2 ARB_imaging

alpha.jnlp

alpha3D.jnlp 1.1

aargb.jnlp 1.1

aaindex.jnlp

multisamp.jnlp 1.3 pic

fog.jnlp

fogindex.jnlp

fogcoord.jnlp 1.4

pointp.jnlp 1.4

polyoff.jnlp 1.1

  

7 Display Lists

Describes use of display lists to increase performance.

torus.jnlp 1.1

list.jnlp

stroke.jnlp

 

8 Drawing Pixels, Bitmaps, Fonts, and Images

How to draw 2D datas, its uses as font.

drawf.jnlp

font.jnlp

image.jnlp 1.1

colortable.jnlp 1.2 ARB_imaging

convolution.jnlp 1.2 ARB_imaging

colormatrix.jnlp 1.2 ARB_imaging

histogram.jnlp 1.2 ARB_imaging

minmax.jnlp 1.2 ARB_imaging

 

9 Texture Mapping

How to map 1D/2D images to geometric objects for added effect.

checker.jnlp

texsub.jnlp 1.1

texture3d.jnlp 1.2

mipmap.jnlp

texbind.jnlp 1.1

texgen.jnlp

cubemap.jnlp 1.3

multitex.jnlp 1.3

combiner.jnlp 1.3

shadowmap.jnlp 1.4

 

10 The Framebuffer

Describes the many uses of possible buffers.

stencil.jnlp

accpersp.jnlp

accanti.jnlp

dofnot.jnlp

 

11 Tesselators and Quadrics

How to use tessellators and quadrics.

tess.jnlp 1.1

tesswind.jnlp 1.1

quadric.jnlp 1.2

 

12 Evaluators and NURBS

Use of curves and surfaces.

bezcurve.jnlp

bezsurf.jnlp

bezmesh.jnlp

texturesurf.jnlp

surface.jnlp 1.1

surfpoints.jnlp 1.2

trim.jnlp 1.1

 

13 Selection and Feedback

Describes use of selection to choose object drawn, and use fo feedback to collect drawing info GL produces.

select.jnlp

picksquare.jnlp

pickdepth.jnlp

feedback.jnlp

 

14 Now that you know

The book has no examples for this chapter.

Querying and Printing an Error

Is an Extension Available

Is a Function Available

 

Update Log

20070227. one archive, repackaged

20060629. fixed texture3d, font

20060606. JWS program to get info about your GL

20060429. moved jnlp files to csclub.cs.sjsu.edu

20060420. 4th ed examples

20060419. page edits, links, ads; fix logo problem

20060417. 3rd ed. ARB_imaging examples available

20060415. remove more JSE1.5 code; many fixes

20060411. red book 2nd ed. available; src|jnlp in jar file