This book and the excerpts on this blog are from 2004. Obviously, the API has changed a bit since then. I provide the older information and book in the hope that it will be useful to some hobbyists.
JSR-231 passed the Final Approval Ballot stage. Did you know Quake 2 has been ported to Java using JOGL? Here’s the website. The JOAL sound appears to be working now, and the graphics are great!. Welcome JOGL gaming!
Author’s Note (very old and unlikely needed): If you experience an “Unable to lock surface” error when running the code samples in this book, try backing out the JOGL build you are using to an April 2004 1.1 release and that should clear up your issue.
This book describes JOGL which was approved as JSR 231 and will become the javax.media.opengl package.
-T. Gene Davis
Table of Contents
Why, what and how come I’m writing this.
Introduction to JOGL and a Hello World to test your installation.
Introduces Cartesian coordinate system. Explanations of some methods used in JOGL apps.
Animator explained and shown in use. Slope of line explained. Circles and transformations discussed.
Chapter 4: Using Events with GLCanvas
Details some of the AWT events that are available when using JOGL components.
Chapter 5: Going 3D
It’s time to enter the 3D world. This is where you’ll find the real matrix.
Chapter 6: Drawing Geometric Primitives
Formally introduce geometric primitives. Also introduce simple GLU quadrics. Discuss GLUT shapes.
Chapter 7: First Person Movement in 3D Space
Briefly touch on translation and then put together what we discussed thus far to show first person movement in JOGL.
Chapter 8: Lights
Ambient and diffuse light explained. Materials for coloring explained. Depth testing explained.
Chapter 9: Textures
Creating textures from images. Loading PNGs and conversion for use by JOGL as textures. Sample code and explanations of how to modify it for other uses.
These are web resources for browsing. They may give further insight into JOGL.
Here are some more web resources for browsing. They may give further insight into OpenGL.
Appendix C: A Little Matrix Math
Matrices are so important to more advanced JOGL work that I felt I should include some details on what they are and how to manipulate them.
Most of the examples in the book are JARed and ZIPed withwith their source code and found here. Just download the ZIPs and expand them to see the JARs and source code. I’ve made some improvements over the code in the book.