5 Replies Latest reply on Feb 7, 2011 10:32 AM by 743856

    [Java 3D] with JOGL

      I'm looking for tutorial to use Java 3D with JOGL.
      I saw that seems to be possible on Java 3D website but I can't see any example (for Direct3D too).
      Else, does anyone know if JOGL 2 is supported or if it will be supported in future ?
      Thanks in advance.
        • 1. Re: [Java 3D] with JOGL

          Java 3D is a high level 3D API in contrast to the low level 3D APIs OpenGL, Direct3D, and the corresponding wrapper APIs like JOGL and LWJGL.

          The Java 3D engine can be run on any of these rendering pipelines: OpenGL, OpenGL/JOGL, or Direct3D. The default pipeline on Windows and Linux is OpenGL, on Mac OS X OpenGL/JOGL. If OpenGL is not available on Windows the engine switches to Direct3D. JOGL is used in Java 3D to avoid an implemention of the JNI/OpenGL-interface for Mac OS X as it is done for Windows and Linux. To choose OpenGL/JOGL on Windows/Linux the system variable 'j3d.rend' has to be set to 'jogl' and to choose Direct3D on Windows the system variable has to be set to 'd3d'. The default value is 'ogl'.

          From the Java 3D application point of view the rendering pipeline is not relevant. The public Java 3D API is independant of the rendering pipeline. Only a few Appearance attributes are not supported on Direct3D.

          So, all Java 3D tutorials, sample programs, or your applications can be run on all pipelines and can't be/don't have to be adapted to OpenGL, OpenGL/JOGL, or Direct3D. You don't have direct access to the pipelines from within your Java 3D application.

          I'm not aware of any advantages for running Java 3D on the OpenGL/JOGL pipeline. On the Direct3D pipeline a faster Java 3D rendering can be achieved than on OpenGL.

          JOGL 1.1.1a is the preferred release to run Java 3D. AFAIK JogAmp's JOGL 2 fork is not downwards compatible. I assume the current Java 3D release wouldn't benefit from it. I'm not aware of anyone working on a next Java 3D release which includes a future JOGL release. I started a Java 3D fork (JUniversal3D, not public yet) and I dropped JOGL as an intermediate API for accessing OpenGL.

          Oracle.Sun stopped all its 3D engagements (Java 3D, JOGL, Wonderland) and hasn't made any substantial anouncement about 3D rendering capabilities for its future JavaFX 2.0. So, it's up to third parties to supply 3D APIs for Java desktop and web applications.

          • 2. Re: [Java 3D] with JOGL
            Thank you, August, for this.
            I got a better view of the situation now.
            Actually, the benefit would be the GL ES support, but maybe J3D already support it.

            That's the thing I didn't uderstand : "the system variable 'j3d.rend' has to be set to 'jogl'".
            I could try this now.
            Bye :)

            Edited by: Djak on 22 nov. 2010 07:30

            Edited by: Djak on 22 nov. 2010 07:31
            • 3. Re: [Java 3D] with JOGL
              Sorry, the right wording is 'system property'. Java 3D system properties can be set as follows:

              I. In your myJava3DApplication.bat/sh-file "java -Dj3d.rend=jogl -cp ... "'


              II. See javadoc of 'java.lang.System': System.setProperty(String key, String value).
              public class MyJava3DApplication {
                  public static void main(String[] args) {
                      // To be called before any Java 3D class is imported
                      System.setProperty("j3d.rend", "jogl");
                      new MyJava3DApplication();
                  public MyJava3DApplication() {
              On the Wiki page 'Java3DApplicationDevelopment' you will find more about Java 3D system properties http://wiki.java.net/bin/view/Javadesktop/Java3DApplicationDevelopment

              • 4. Re: [Java 3D] with JOGL
                Thanks you :)
                I tested and it works fine with JOGL 1.1.1.
                But, I need to use GL ES from JOGL2.0.

                Edited by: Djak on 25 nov. 2010 02:47
                • 5. Re: [Java 3D] with JOGL
                  Hi, if your question is still actual i can advice you one book http://fivedots.coe.psu.ac.th/~ad/jg2/ writen by Andrew Davison.It' describe best practice of working with JOGL, i read it now and i like it so much, i think it'll be very usefull for you.

                  Take it easy.

                  Edited by: Ishikawa on 06.02.2011 23:52

                  Edited by: Ishikawa on 07.02.2011 2:32