What to expect
This tutorial is designed to help you learn how to write Java applications using the jReality package. You should already know how to program in Java. If you work through the examples shown here, you'll be able to create your own hierarchical scene graphs and populate them with a wide variety of geometry, appearances and transformations. You'll learn how to set camera and lights. You'll also learn how to write your own interactive tools and insert them into the scene graph. Finally you'll learn helpful tips for optimizing your performance and avoiding some common pitfalls.
Most of the tutorials demonstrate how to do a certain thing in jreality, based on a short code example.
Bold tutorial links contain documentation or detailed background information.
Suggestions and corrections to gunn at math.tu-berlin.de.
For accessing the newest jReality source code, see Checking out the current jReality source.
For command line usage, consult this document, which also gives directions for installing JOGL, a java package which jReality uses to obtain hardware accelerated rendering.
As you work through this tutorial, you may wish to consult the following documents which describe more conceptually how jReality works:
- an overview of jReality features, and
- a more detailed look at the jReality scene graph.
- JavaDoc browser for the jReality package.
Each of the following tutorial examples is structured as follows:
- A link to the full source code of the Java class in the de.jreality.tutorial directory,
- Optional links to the JavaDoc of the jReality classes featured in the tutorial class,
- A link to run the tutorial example as a Java webstart,
- Commentary on selected parts of the source code, and
- A screenshot showing the intended result of running the tutorial example (not always present).
The Java classes which are contained in this tutorial can also be found in the jReality source tree under the folder src-tutorial if you wish to work with them directly. They can all be run as standalone Java applications.
- Introduction to jReality programming. The following sequence of tutorial examples is designed to teach you the basics of jReality programming. It is generally modeled on the User Tutorial. Here, you will learn how to program the capabilities that you there learned how to activate interactively. (Old version here.)
- Use geometry factories
- Use a point set factory
- Use an indexed line set factory
- Use an indexed face set factory
- Use a quad mesh factory
- Use a parametric surface factory
- Use a tube factory
- Use a ball and stick factory
- Use a thickened surface factory
- Use a geometry merge factory
- Use a clipping plane
- Display 3D text
For an introduction to the use of appearances in jReality, see the introductory tutorial (this section and this section). The following examples assume you have mastered the fundamentals presented there.
- Use a geometry shader
- The default shaders
- Use a non-default shader
- Use a 2d texture
- Use an animated 2d texture
- Use a skybox and reflection map
- Use an OpenGL Shading Language shader
- Use vertex arrays in JOGL backend
- Use shaded lines in JOGL backend
- Use the root appearance
- Use vertex colors on a point set
- Options for background rendering
Input / Output
- Most developers will be content to write specific tools.
Developers who want to add new devices need to learn about the tool system.
Lights and cameras
- The jReality audio rendering pipeline
- Writing applications with audio
- Writing audio sources
- Odds and ends
- Open Sound Control
- The simplest JRViewer example
- Add VR functionality
- Extract viewer from JRViewer
- Create a standalone viewer
- Use selection capabilities
- Mix JOGL graphics with 2D Java graphics
- Use accelerated 2d textures with JOGL backend
- Use a performance meter with JOGL backend
- Render into a BufferedImage
Graphical user interface
JReality provides a plugin-based system to create user interfaces.
- Adding panels for user interaction to JRViewer
- Use the full power of jReality's plugin system
- Explore noneuclidean geometry
- Use JLink to read from Mathematica
- Use jReality with jruby
- Use jReality with jython
- Use jReality with groovy
- Sphere Point Sprites and Instanced Tubes
- Textures of imported OBJ files
- Custom GLSL Shaders
- more than 1000 geometries