23
Java 3D Web Apps and Services

Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Embed Size (px)

Citation preview

Page 1: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Java 3D

Web Apps and Services

Page 2: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Presentation Overview

Java3D Overview Software Java3D API Scene Graph Programming Model Java3D Terminology Examples Java3D Vs OpenGL Applications

Page 3: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 4: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 5: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Java3D Software to Hardware Relationship

Applet /

Application Java3D

Java 2

Native Graphics Calls

OpenGL Direct 3D Future APIs

Proprietary Hardware

Page 6: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 7: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Requirements contd… OpenGL Libraries

Gl.h Glaux.h Glaux.lib Glu.h Glu32.dll Glu32.lib Readme

Page 8: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 9: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 10: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 11: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 12: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 13: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 14: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Scene Graph Symbols

Arcs (object relationships)

VirtualUniverse

Locale

Group

Leaf

Node Component

Other objects

Parent-child link

Reference

Nodes and Node Components (objects)

Page 15: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Typical scene graph (DAG)

BranchGroupBGBG BG

Virtual Universe

Locales

Nodes

Leaf Nodes

Page 16: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 17: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

OpenGL Vs Java3D

Java3D

high level; OO appli programmers different rendering

modes

OpenGL

low level; procedural system programmers immediate mode

rendering

Page 18: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 19: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Rendering modes contd...

Compiled-Retained• builds on retained mode

• enhanced optimization viz geometry compression, grouping and scene graph flattening

Page 20: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 21: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

Areas of Application

OpenGL• Games

• Flight simulation

Java3D• Complex 3D graphics

• applets for spicing up web sites

Page 22: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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

Page 23: Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l

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/