Java 3D Introduction Stefan Rufer Assistant Computer Science Departement

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation F To understand the.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
Further Programming for 3D applications CE Introduction to Further Programming for 3D application Bob Hobbs Faculty of Computing, Engineering and.
Java 3D Pablo Figueroa University of Alberta April 2000.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
SET09115 Intro Graphics Programming
Basic 3D Graphics Chapter 5. Bird’s Eye View  Basic 3D Graphics –Basic concepts of 3D graphics, rendering pipeline, Java 3D programming, scene graph,
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
1 Introduction to Java 3D Java 3D Overview v API for 3D applications v Portable.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS324e - Elements of Graphics and Visualization Checkerboard World.
Java3D Overview Scene graph Java 3D classes Describing objects Groups, transforms Behaviors, interpolators Lighting.
UniS CS297 Graphics with Java and OpenGL Introduction.
CSE 381 – Advanced Game Programming Basic 3D Graphics
1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
UniS CS293 Graphics with Java and OpenGL Introduction.
A Simple Talk on Java 3D Presented by C.H. Chen on Jul. 6, 2004.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
INTRODUCTION INTRODUCTION Computer Graphics: As objects: images generated and/or displayed by computers. As a subject: the science of studying how to generate.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
COMPUTER GRAPHICS Hochiminh city University of Technology Faculty of Computer Science and Engineering CHAPTER 01: Graphics System.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Game Programming 06 The Rendering Engine
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Vector Graphics Digital Multimedia Chap 이병희
CS324e - Elements of Graphics and Visualization Java 3D Intro.
VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
INTRODUCTION GORT is a virtual 3D modeling environment for computer programmers. Its main area of focus is to aid in the education of programmers learning.
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.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
1 9 Lighting a Scene v There are four types of lighting: –ambient light –directional light –point light –spotlight v Any number of these can be added to.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Interpolators Alpha Object Billboard Level of Detail (LOD) Morphing.
Chapter 1 Graphics Systems and Models Models and Architectures.
- Introduction - Graphics Pipeline
Computer Graphics.
Photorealistic Rendering vs. Interactive 3D Graphics
Introduction to Graphics Modeling
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Understanding Theory and application of 3D
3D-Online Product Configuration by Java3D
© University of Wisconsin, CS559 Fall 2004
Presentation transcript:

Java 3D Introduction Stefan Rufer Assistant Computer Science Departement

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Todays Contents Start Introduction to Computer Graphics Java 3D Tutorial Chapters – Layout: Technical Introduction Application in Java 3D Example Programs

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Foreword Installing Java 3D Running Java 3D Programs Warm-up Course overview References & Sources

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Objectives Appetizer for the Course. Know how to compile and run Java 3D programs. Know where to search in case of troubles or further interest.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Foreword Determine the correct color for every pixel. This course is programming oriented. Why to learn Java 3D? It is object oriented. It is 3D. It is fun.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Installing Java 3D School PCs have Java 3D installed Make sure that JDK or later has been initialized (NAL -> Java -> Initialize...). The SUN environment does not include Java 3D per default Check web-page for details and troubleshooting # Add some directories to your PATH #original: PATH ${HOME}/bin:${PATH}: PATH /tools/java/JDK-1.2-AND-Java3D-1.1/bin:${HOME}/bin:${PATH}:

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Running Java 3D Programs Copy source from intranet It is so simple – but IF... have a look on the web page for troubleshooting (all JARs at the right place, also in the JRE?). >javac Program.java >java Program

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Warm-up Simply let us try some examples...! Chapter Start, paragraph Warm-up.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start Course Overview DateSubjectRemark Start / Introduction to Computer Graphics Hello World! / The Virtual UniverseTutorial Chapter 1, Transformations / SceneBuilder Creating Geometry / Easier Content CreationTutorial Chapter 2, InteractionTutorial Chapter AnimationTutorial Chapter LightsTutorial Chapter TexturesTutorial Chapter Spline, Ray-Tracing, Future Project Work Kick-offProject work by one, two or three people. Proposals for projects will be accepted Project Work Project Work Project Work Project Work Project Work Project Work Presentations of the Project Works Holiday

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Start References & Sources SUN and intranet web pages, links found in documentation. Use the glossary, it makes live easier if you know about what exactly you are talking.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Intro to Computer Graphics Why Java 3D 2D versus 3D Color Models Hardware Java 3D Tutorial

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Objectives Understand some essential basics of computer graphics like color models. Get an idea of what hardware is involved if doing computer graphics.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Why Java 3D 3D-modelers like Art*lantis Easy content creation Pre-programmed „static“ behaviour Many pre-defined shapes, extrusions, textures... 3D-languages like Java 3D or OpenGL High degree of user interaction Start on the „green field“ Create new 3D applications (CAD, Simulator,...) 3D-renderers like PovRay No interaction, only one picture

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics 2D versus 3D 2D R 2 => R 2 Simply two dimensional picture on 2D-Screen. 3D R 3 => R 2 Match three dimensional mathematical model to two dimensional Screen. A new approach are Holography techniques R 3 => R 3 but that‘s maybe beyond the scope of this course...

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Color Models RGB is the most most important color model for computer graphics. Additive system Red, Green, Blue, 8bit each Java 3D: each color has values 0..1 Application example: ColorSpace Other systems: CMYK, HSB...

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Hardware (1) Graphic Cards minimize processor load by executing graphic commands in hardware. DirectX OpenGL Raster Screen have an x-y pixel array (=raster) to display our graphics CRT LCD Counterpart: Vector graphic devices such as analog cathode-ray oscilloscopes.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Hardware (2)

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Introduction to Computer Graphics Java 3D Tutorial Tutorial by SUN Great (as usual, it is SUN...) Use this and the API as your reference!

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Basics Scene Graph Locales Content Branch View Branch Understanding MyUniverse Recipe for a simple Program

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Objectives Know what a virtual universe and a scene graph is. Understand the basic parts and elements of a scene graph. Know the basic recipe for a Java 3D program.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Basics A virtual universe can be seen as a 1:1 representation of our own universe. Represent structures from astronomical to subatomic. Floating point 3D space: 2^256 (!!) for each x,y,z. Decimal point for 1 meter at 2^128 -> incredible precision at incredible extend. There is one VU-instance only (Singleton).

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Scene Graph (1) Scene Graph is the graphical representation of the objects in our VU. Directed Acyclic Graph (Tree) Nodes, arcs, parents, childs, leaves, references and other objects. VirtualUniverse Locale Group Leaf NodeComponent Other objects Reference Link

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Scene Graph (2) A Java 3D program may have more objects than those in the scene graph. A scene graph drawing is the correct documentation for the 3D part of a Java 3D program.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Scene Graph (3) Basic parts of a scene graph myVirtualUniverse myLocale Branch Group a3DobjectmyViewPlatform View Branch Content Branch Locale(s)

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Locales (1) How to handle the huge extend of a virtual universe efficiently? Our virtual universe contains at least one Locale. The locale is a 3D-reference point inside the virtual universe.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Locales (2) Standard Locale resides at (0,0,0) in the VU. We can have several Locales, eg: One as reference point of the swiss coordinate system (located in Bordeaux, France). A second as the architects reference point of a building plan. The both are related, but depending on the point of view it is more convenient (and precise) to work with one or the other.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Content Branch (1) Contains all „visible“ objects of our scene. Contains all transformations for those objects (displacement, animation,...). We distinguish between group nodes and leaf nodes (see following slide).

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Content Branch (2) The most common object types Branch Group Shape3D Appearance Transform Group...

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe View Branch The Canvas3D will be inserted in our application or applet -> most important!

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Recipe for a simple Program 1. Create a Frame & a Canvas3D object. 2. Create a SimpleUniverse object which gets a reference to the Canvas3D. 3. Construct the content branch. 4. Insert the content branch into the Locale of the SimpleUniverse.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction The Virtual Universe Exercises Check Web-Page, chapter „Virtual Universe“

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World The Java 3D API Finally: Hello World! Source Code Class Diagram of HelloJava3D What happens when running? Exercises

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World Objectives Understand the high-level structure of the APIs involved in a Java 3D program. Understand the code of the HelloJava3Da example line by line.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World The Java 3D API Packages related to the Java 3D API: Core classes: javax.media.j3d Utility classes: com.sun.j3d.utils Math classes: javax.vecmath AWT classes: javax.swing

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World Finally: Hello World! Probably the most simple Scene Graph

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World Source Code public class HelloJava3Da extends Applet { public HelloJava3Da() { setLayout(new BorderLayout()); Canvas3D canvas3D = new Canvas3D(null); add("Center", canvas3D); SimpleUniverse simpleU = new SimpleUniverse(canvas3D); simpleU.getViewingPlatform().setNominalViewingTransform(); BranchGroup scene = createSceneGraph(); simpleU.addBranchGraph(scene); } public BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup(); objRoot.addChild(new ColorCube(0.4)); return objRoot; } public static void main(String[] args) { Frame frame = new MainFrame(new HelloJava3Da(), 256, 256); }

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World Class Diagram of HelloJava3D

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World What happens when running? while (true) { Process input Perform Behaviours //none at the moment Traverse scene graph and render visual objects if (request to exit) break } Cleanup and exit

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Hello World Exercises Check Web-Page, chapter „Hello World“

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Geometic Utility Classes Mathematical Classes Geometry Classes GeometryArray Classes GeometryStrip Array Classes Indexed Geometry Appearance and Attributes Point- + LineAttributes PolygonAttributes

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Objectives Get an overview on how to handle polygones in Java 3D. Know the most important attributes that determine the look of a polygone.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Geometric Utility Classes Box (2x2x2 m) Cone (Ø2m, height 2m) Cylinder (Ø2m, height 2m) Sphere (Ø2m) Default color white Tutorial Page 2-6

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Mathematical Classes (1) Tuples are simply pairs or triples of numbers. For each vertex there can be up to four javax.vecmath objects: Points for coordinates Colors Vectors for normals TexCoords for texture coordinates Tutorial Page 2-15

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Mathematical Classes (2) Vectors: mostly used for normals and position information in 3D-space. Normals: determined using the right hand (remember: we have a right- handed system). P0 P1 P2 n

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Geometry Classes What to do if our shape is not a box or a cylinder? Create Shape3D-object, use setGeometry() method! For a triangle: Three-element array One point per element Tutorial Page 2-20

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content GeometryArray Classes Most primitive form to create shapes: Points or lines are one pixel wide per default. Colors are interpolated from vertex to vertex if specified. (see code page 2-24, line 9+10) Tutorial Page P0P1

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content GeometryStripArray Classes More convenient: share some vertices: Example Yoyo: Ever tried to model a Jumbo-Jet by hand? Often geometry is generated by mathematical calculations. Tutorial Page 2-27

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Indexed Geometry Best re-use of vertices but we lose performance using the index array. Tutorial Page 2-27

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Appearance and Attributes Appearance class does not specify the appearance directrly but contains many links to appearance objects: Tutorial Page 2-34

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content Point- + LineAttributes Points and Lines are 1 pixel wide by default. Zooming does not affect this. Let‘s try to change: Thikness of the line Antialiasing Tutorial Page 2-37

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Creating Content PolygonAttributes We can set the PolygonMode: Fill: fill the interior of the polygones Line: connect vertices with lines („Drahtigttermodell“) Point: draw only points at the vertices Face culling: Hide front, back or none of the faces of a polygon. Tutorial Page

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Class Loaders Handle a bunch of objects Text in 2D and 3D Background Bounding Leaf

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Objectives Be able to load and display non-Java 3D objects in a scene. Understand background and bounding leaf and why one of the two is not enough.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Class Loaders Load 3D scene files and create Java 3D representations (branch graph). Read and parse file Create Java 3D objects Return branch group object with all the scene contents Insert branch group in the scene -> J3D API Demos:..\ObjLoad\java ObjLoad..\geometry\galleon.obj Tutorial Page 3-2

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Handle a bunch of points First create a GeometryInfo object. Now many operations can be performed on this object (and on our data): Generate Normals „Stripifying“ „Compacting“ Example: GeometryInfoApp.java Tutorial Page 3-7

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Text in 2D and 3D Text2D creates a rectangular polygone and a texture on it. Text3D creates geometry objects for the text that have an extrusion. Tutorial Page

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Background Background can be a solid color, an image and/or a geometry. Background is infinitely far away, you can not go or see what‘s behind. Tutorial Page 3-22

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Easier Content Creation Bounding Leaf Used for different classes: Light, Fog, Behaviour or Background. Only an intersection with the bounding leaf of such an object makes it visible.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Interpolators Alpha Object Billboard Level of Detail (LOD) Morphing

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Objectives Get an impression of the different forms of animation. Be able to animate objects using an Interpolator and Alpha object.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Interpolators Change all important 3D-object data easily. Interpolators do not change the corresponding value automatically -> Alpha object needed. Tutorial Page 5-11

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Alpha Object (1) Tutorial Page 5-7 Alpha objects generate events distributed over time. They are used as trigger events for the interpolators. Some of the possible wave-forms f(t):

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Alpha Object (2) Tutorial Page 5-7 AlphaAtOneDuration PhaseDelayDuration AlphaAtZeroDuration TriggerTime

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Put it together TransformGroup objRotate = new TransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Alpha alpha = new Alpha (); RotationInterpolator rotInt = new RotationInterpolator (alpha, objRotate); rotInt.setSchedulingBounds(bounds); objRotate rotInt alpha Trigger events Change Transform3D

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Billboard Show complex (background) geometry, e.g. trees. Troubles with different views. These objects are flat: Tutorial Page 5-26

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Level of Detail (LOD) As closer you are as more details you want to see -> LOD. Several childs of a Switch node, choose the right one. Long developement time for creating the objects with different detail levels. Tutorial Page

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Morphing „Interpolator for geometry“. You have to define the key frames. The Morph class will interpolate between the key frames. -> Try the Java 3D example \jdk1.3\demo\java3d\Morphing\Morphing.java Tutorial Page 5-36

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Animation Exercises Find description on the web page (chapter animation): Tutorial Page 5-36

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Java 3D Lighting Model Influence Different Light Types Mixing Lights Material Objects Other Coloring Possibilities Shadows

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Objectives Understand the Java 3D lighting system. Know about the different ways to give a color to an object. Recall the theory about additive light mixing. Tutorial Page 6-2

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Java 3D Lighting Model There are three different reflections: Ambient (caused by ambient light) Diffuse („normal“ reflection) Specular (highlight reflections of polished material) No inter-object reflections in Java 3D. Light sources are not visible itself. Tutorial Page 6-2

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Influence There is no warning for leaving light out of a scene. There is no warning for not setting a light source its influencing bounds. Some light types have a attenuation setting. Tutorial Page

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Different Light Types Ambient light As if the sky was cloudy. Directional light For the virtual „sun“. Point light For virtual lamps. Spot light Virtual spot lamps. Tutorial Page 6-11 ff

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Mixing Light Why does an object appear in a certain color? White sphere, red and blue light -> result? Tutorial Page 6-17

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Material Object Color settings of the material object represent „reflection coefficients“. Shininess is an interesting value. Tutorial Page 6-21

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Other Coloring Possibilities No lights needed, but no „shiny“ effects: ColoringAttributes Per-vertex color (KickCan example: class Floor). Tutorial Page 6-23

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Lights Shadows There are no built-in shadows in Java 3D. Shadows in the tutorial are created using hand-made classes and polygones.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Textures Basic Principles Create a Simple Texture

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Textures Objectives Know what a texture is and why we need it. Be able to program simple textures.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Textures Basic Principles Detailed surface structures are hard and expensive to build in 3D -> Texture! „Texel“ is „texture element“ -> one pixel of a texture. Texture mapping: Fit image to a given geometry.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Textures Create a Simple Texture Load an image Create a texture Create 3D- object with appearance String filename = "earth.jpg"; TextureLoader loader = new TextureLoader(filename, this); ImageComponent2D image = loader.getImage(); Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA, image.getWidth(), image.getHeight()); texture.setImage(0, image); Appearance appear = new Appearance(); appear.setTexture(texture); Sphere earth = new Sphere(1.0f, Primitive.GENERATE_TEXTURE_COORDS, appear));

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Information Gathering Set-up Deliverables

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Objectives Apply all what you have learned. Learn more of the Java 3D API and 3D computer graphics. Know what you want to do -> concept, system design,...

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Information Gathering Search the web, get ideas. Do a brain storming or something similar -> write down your ideas. Form project groups. Discuss your ideas so that you get ready to start with a concept.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Set-up Participants of the project. Discussed your idea with the teacher.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Deliverables The deliverables are: source and documentation of the project. Documentation as HTML page or paper. Turn in source and documentation: ZIP file by mail (or link for download if size > 1MB) or CD-ROM

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More... Spline Functions 3D-modelling Professional Rendering POVRay Example

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More… Objectives Get a little outlook on what happens outside of Java 3D. Have an idea of professional tools used in computer graphics. Hands-on experience with POVRay.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More… Spline Functions Base: Spline Functions Applications of Spline Functions in: Spline Curves, Spline Surfaces Advantages: Smooth surfaces (!) Application in Java 3D: com.sun.j3d.utils.behaviors.interpolators.TCBSplineInterpolator

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More… 3D-modelling LightWave ( ZOOM

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More… Professional Rendering Rendering for films like Toy Story or Titanic is done with rendering products. Performance is far from real time but the experience pretty close to real world. Examples of Products: PRMan ( BMRT ( POVRay (

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction A Bit More… POVRay Example Download POVRay from ftp.hta-bi.bfh.ch (Windows Version) Install locally Create a ready-made scene Play around

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project What to do? A Paper describing a 3D computer graphics related aspect. A Java 3D program (little demo, game, a start for a bigger project…). A demo with an other 3D software (PRMan, BRMT, PovRay). A picture of a 3D-contest (e.g. PovRay).

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Presentations Deliverables Presentations!

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Presentations Deliverables Turn in source and documentation: ZIP file by mail (or link for download) or CD-ROM Due Date: 2 nd March 2001

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project Presentations Presentations! 1Daniel Glauser3D-Bomberman 2Ramon Keller3D-Schach 3Nicolas LeubaFisch-Aquarium 4Roger Mathys Pascal Moser Murmelbahn 5Philippe Schnyder Philippe Schoch Markus Trachsel 3D-Würfel 6Stefan RuferRenderMan / BMRT

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project RenderMan / BMRT What is RenderMan? What is BMRT? What is Radiosity?

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project RenderMan / BMRT What is RenderMan? Open interface by Pixar. Interface for 3D-model rendering. Provides extension possibilities for custom shading and gadgets. This is NOT an implementation.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project RenderMan / BMRT What is BMRT? BMRT is a free 3D-renderer by BlueMountain Corp. BMRT is partly RenderMan compatible. Contains various tools. Most important: rgl : Simple, fast renderer for previews. rendrib : High-end renderer providing ray- tracing, radiosity, programmable shading…

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project RenderMan / BMRT What is Radiosity? Imagine: Blue room with white chair  chair appears a bit blue! Compute diffuse, inter-object reflections RayTracing uses AmbientLight to simulate this  not too good. Radiosity approximates diffuse, inter- object reflections.

Stefan Rufer, HTA Biel, 2000 Java 3D – an Introduction Project RenderMan / BMRT Radiosity examples rendrib quality rgl preview