These are Java ports I’ve made of the NeHe OpenGL tutorials. I ported these mainly as a learning experience for myself, but since other people might find this stuff useful I’m making them available here.
The jars listed below contain both the compiled java code and the source code. You can also get my complete project structure (all source, resources, build script, …) by downloading the source distribution.
These tutorials were written using the JSR-231 api (javax.media.opengl).

Download

Requires Java 1.4 or higher and a JSR-231 implementation
Source code for all lessons
Lesson 01 - Setting up an OpenGL window
Lesson 02 - Your first polygon
Lesson 03 - Adding color
Lesson 04 - Rotation
Lesson 05 - 3D shapes
Lesson 06 - Texture mapping
Lesson 07 - Texture filters, lighting and keyboard control
Lesson 08 - Blending
Lesson 09 - Moving bitmaps in 3D space
Lesson 10 - Loading and moving through a 3D world
Lesson 11 - Flag effect (waving texture)
Lesson 12 - Display lists
Lesson 13 - Bitmap fonts
Lesson 14 - Outline fonts
Lesson 15 - Texture mapped outline fonts
Lesson 16 - Cool looking fog
Lesson 17 - 2D texture font
Lesson 18 - Quadrics
Lesson 19 - Particle engine using triangle strips
Lesson 20 - Masking
Lesson 21 - Line, antialiasing, timing, ortho view and simple sounds (requires GAGETimer)
Lesson 22 - Bump mapping, multi texturing and extensions
Lesson 23 - Sphere mapping quadrics in OpenGL
Lesson 24 - Tokens, extensions, scissor testing and TGA loading
Lesson 25 - Morphing and loading objects from a file
Lesson 26 - Clipping and reflections using the stencil buffer
Lesson 27 - Shadows
Lesson 28 - Bezier patches
Lesson 29 - Blitter function, RAW texture loading
Lesson 30 - Collision detection
Lesson 31 - Model loading (by Nikolaj Ougaard)
Lesson 33 - Loading compressed and uncompressed TGAs
Lesson 34 - Beautiful landscapes by means of height mapping
Lesson 36 - Radial blur and rendering to a texture (using framebuffer objects if available)
Lesson 37 - Cel shading
Lesson 39 - Introduction to physical simulations
Lesson 42 - Multiple viewports
Lesson 44 - 3D lens flare with occlusion testing
Lesson 45 - Vertex buffer objects
Lesson 47 - GLSL vertex shader (original nehe demo uses Cg)
Lesson 48 - ArcBall rotation


6 Responses to “NeHe Java ports”  

  1. Gravatar Icon 1 Pernil

    Thank you!!. This port is so good to understand Jogl and work with this. Are you updating this codes or they are the final version?.

  2. Gravatar Icon 2 Pepijn

    Those that are published here are more or less final unless somebody reports bugs. If I find some time I might add the missing ones from the NeHe site.

  3. Gravatar Icon 3 ChinaDragon

    You use package javax.media.opengl.*
    this is use openGL in java3D OR jogl?
    I use package net.java.games.jogl.*;
    I want to ask what’s the different ?
    and another question:
    //——————————————–
    ……
    GLCapabilities glCaps = new GLCapabilities();

    GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas( glCaps );
    canvas.addGLEventListener(new Renderer());
    ……

    public void display(GLDrawable drawable) {

    }
    ——————
    why display run only once ! I used thread to
    “while(true) {display(drawable)}”it but no draw!

    you used neheGLDisplay.start(); it can reflash??

    Thank you ! waiting for you answer

  4. Gravatar Icon 4 Pepijn

    net.java.games.jogl is the package name that was used by jogl. Jogl was used as the basis for the reference implementation of jsr-231. This api uses the javax.media.opengl package name. As far as I know the old jogl is not being developed anymore and has been replaced by jsr-231. Unfortunately the new api has retained the jogl name, which might be a bit confusing. You can find more details at https://jogl.games.dev.java.net.

    For questions related to the correct usage of these apis I recommend you check out the Java Gaming forums at http://www.javagaming.org. There is a forum dedicated to jogl there.

  5. Gravatar Icon 5 Nikolaj

    I have a port for Lesson 31. Would it be something you´re interested in???

  6. Gravatar Icon 6 dmgaskin

    I just downloaded and installed the “Source Code for all lessons” and tried each of the lessons. Several did not run immediately. I traced the problem to 2 small errors.

    Error One
    =======
    /resources/demos/data/images/Font.png

    Should not have a Capital “F” i.e. the file needs renaming to
    font.png

    Error Two
    =======

Leave a Reply

You must log in to post a comment.