Download presentation
Presentation is loading. Please wait.
Published byAlbert Lee Modified over 9 years ago
1
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics
2
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 2 Objectives F To describe the 3D rendering process F To present an overview of Java 3D programs F To define Java 3D scene graph F To classify components of a scene graph F To apply background nodes F To understand and apply bounds objects F To make changes in live scene graphs
3
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 3 3D Model and View
4
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 4 Rendering Considerations F Geometry of the graphics objects F Location and position of the objects F Geometric transformations applied to objects and views F Material properties and texture of the objects F Lights and their characteristics F Type of projections in a view F View position, field of view, and other properties F Illumination and shading models F Dynamic behaviors of various components F Reactions to the user inputs
5
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 5 Java 3D Overview F Automatic rendering F Modeling with a scene graph F Object oriented Source Run A Java 3D Hello program
6
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 6 Scene Graph: DAG A digraphA DAGA tree
7
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 7 Scene Graph: Legend
8
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 8 Scene Graph
9
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 9 Scene Graph: Classes
10
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 10 Superstructure F VirtualUniverse – the universe F HiResCoord – 256bit fixed point numbers F Locale – a “smaller” space
11
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 11 Group Nodes F BranchGroup F OrderedGroup F Primitive F SharedGroup F Swith F TransformGroup
12
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 12 Leaf Nodes
13
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 13 Node Components
14
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 14 Scene Graph The Java 3D “Hello” program
15
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 15 Use SimpleUniverse F Create a Canvas3D object F Create a SimpleUniverse object F Add content branch
16
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 16 Do It Yourself F Create superstructure –VirtualUniverse –Locale F Create the view branch –BranchGroup –TransformGroup –ViewPlatform –View –PhysicalBody –PhysicalEnvironment Source Run
17
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 17 Background F Default background: black F Change background with the Background node Source Run Background() Background(Color3f color) Background(float r, float g, float b) Background(ImageComponent2D image) Background(BranchGroup geometry)
18
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 18 Bounds F Environmental nodes need to be limited by bounds F Two ways: –Bounds, node component –BoundingLeaf, node Source Run
19
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 19 Live Scene Graph F A branch is live when attached to Locale F Compile may improve performance F Set capability bits explicitly to change attributes in a live scene graph Source Run public final void setCapability(int bit)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.