Java 3D Web Apps and Services
Java 3D
Web Apps and Services
Presentation Overview
Java3D Overview Software Java3D API Scene Graph Programming Model Java3D Terminology Examples Java3D Vs OpenGL Applications
Java3D Overview
standard extention to Java 2 Java3D API is an interface for writing programs
to display and interact with 3D graphics provides high level constructs for creating
images, visualizations, animations and interactive application programs
Overview contd...
hierarchy of classes which serve as an interface to a sophisticated 3D graphics rendering system
programmer works with high level constructs which use popular graphics libraries
Java3D Software to Hardware Relationship
Applet /
Application Java3D
Java 2
Native Graphics Calls
OpenGL Direct 3D Future APIs
Proprietary Hardware
Software
Java3D classes (duh!!) Java 2 OpenGL 1.1 OR Direct 3D 5.0 or later
OpenGL or Direct 3D supported graphics
accelerator for best viewing
Requirements contd… OpenGL Libraries
Gl.h Glaux.h Glaux.lib Glu.h Glu32.dll Glu32.lib Readme
Requirements contd...Java3D files
Required files: <install dir>\jre\bin\
• J3D.dll
• J3Daudio.dll
<install dir>\jre\lib\ext• vecmath.jar
• j3dcore.jar
• j3daudio.jar
• j3dutils.jar
Optional files:
<install dir>\demo\j3d <install dir>\j3d-utils-
src.jar
The Java3D API
object-oriented API individual graphics elements - separate objects
connected by a scene graph the objects are manipulated to create the desired
effect the API has core classes and utility classes
API contd...
Core Classes
javax.media.j3d package lowest level classes
required for Java3D programming
Utility Classes
com.sun.j3d.utils package
convenient and powerful additions to the core
API contd ...
progams use java.awt package to display the rendering in a window
java.vecmath package defines classes for points, vectors, matrices ad other mathematical objects
Java3D Terminology
Scene Graph: The Java3D data stucture that specifies the visual object and viewing parameters
Virtual Universe: The conceptual space in which the object exists
Locale: It provides a reference for all objects
Scene Graph Programming Model
Java3D core API framework is based on the scene graph programming model
pictures rendered with Java3D - scenes Scene Graph
• design tool
• requirements
• documentation
Scene Graph Symbols
Arcs (object relationships)
VirtualUniverse
Locale
Group
Leaf
Node Component
Other objects
Parent-child link
Reference
Nodes and Node Components (objects)
Typical scene graph (DAG)
BranchGroupBGBG BG
Virtual Universe
Locales
Nodes
Leaf Nodes
Basic Recipe
Create a Canvas3D object Create a SimpleUniverse object which references
the Canvas3D object• customize the SimpleUniverse object
Construct the content branch Compile the content branch graph Insert the content branch graph into the locale of
the SimpleUniverse
OpenGL Vs Java3D
Java3D
high level; OO appli programmers different rendering
modes
OpenGL
low level; procedural system programmers immediate mode
rendering
Java3D Rendering Modes
Immediate mode• all point, line, triangle info is provided to the rendering engine
which forces the rendering in any manner, immediately
• no room for global optimization (at scene graph level)
Retained mode• scene graph otimization
Rendering modes contd...
Compiled-Retained• builds on retained mode
• enhanced optimization viz geometry compression, grouping and scene graph flattening
Comparison contd...
Java3D Java: language of the
Internet portability
• write once “render” everywhere
appli programmer can concentrate on objects
web-based, powerful tool, runs inside the browser
Low level APIs
Fast less memory required
Areas of Application
OpenGL• Games
• Flight simulation
Java3D• Complex 3D graphics
• applets for spicing up web sites
Resources
Software• http://www.javasoft.com
• http://www.opengl.org
Tutorials• http://www.cs.albany.edu/~nilesh/sw
• http://java.sun.com/products/java-media/3D/collateral/#tutorial
Resources contd...
Package index• http://java.sun.com/products/java-media/3D/forDevelopers/
j3dapi/index.html
Important links- Java3D• http://www.radialsoft.com/cadcam/java3D.htm
OpenGL• http://reality.sgi.com/opengl/