Download presentation
Presentation is loading. Please wait.
Published byDennis Miles 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 12 Additional 3D Topics
2
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 2 Objectives F To define and implement 3D curves F To define and implement 3D surfaces F To use sound in Java 3D scene graphs F To create simple shadows F To understand dynamic geometry change F To use off screen rendering for capturing rendered images. F To apply 3D texture mapping F To understand and implement synthetic textures
3
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 3 3D Bezier Curves Bernstein basis Cubic Bezier curve General Bezier curve
4
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 4 deCasteljau Algorithm
5
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 5 Subdivision
6
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 6 Implementation F deCasteljau algorithm F Subdivide recursively F LineStripArrary F Fixed level of subdivisions SourceRun
7
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 7 Bezier Surfaces F Tensor product of Bezier curves F Bi-cubic Bezier surface is the common type F deCasteljau algorithm can be applied SourceRun
8
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 8 The Utah Teapot F A famous object in computer graphics F Constructed with Bezier patches SourceRun
9
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 9 3D Sound F Added as leaf nodes in scene graphs F Similar to Light SourceRun
10
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 10 Shadows SourceRun
11
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 11 Dynamic Geometry Change F Create the geometry with BY_REFERENCE. F Write a class implementing the GeometryUpdater interface. Implement the method updateData(Geometry) in GeometryUpdater to perform the modifications on the geometry. F Implement a Behavior class. At appropriate moments, call the method updateData(GeometryUpdater) in GeometryArray to trigger the update.
12
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 12 Example: Moving Shadows Source Run
13
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 13 Off-Screen Rendering public Canvas3D(GraphicsConfiguration gc, boolean offScreen) view.addCanvas3D(canvas) ImageComponent2D buffer = new ImageComponent2D(ImageComponent.FORMAT_RGB, bImage); canvas.setOffScreenBuffer(buffer); canvas.renderOffScreenBuffer(); canvas.waitForOffScreenRendering(); bImage = offScreenCanvas.getOffScreenBuffer().getImage(); Create off screen canvas Attach to view Capture images SourceRun
14
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 14 3D Texture Mapping F 3D to 3D mapping F Uses a 3D volumetric texture source F Consumes more computing resources in terms of generation and storage of 3D texture data F Realistic texture features of true 3D characteristics can be rendered with relatively simple mapping functions
15
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 15 Perlin’s Noise Smooth and random function Source
16
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 16 Example: Marble Texture SourceRun
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.