Presentation is loading. Please wait.

Presentation is loading. Please wait.

3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.

Similar presentations


Presentation on theme: "3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0."— Presentation transcript:

1 3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0

2 Bina Nusantara Learning Outcomes In the end of this session, students must be able to: –Understand the basic principal of 3D objects

3 Outline 3D Coordinates systems 3D Models 3D Transformation 3D Rendering Java 3D API Bina Nusantara

4 Coordinate Systems Use x,y,z coordinates to represent a 3D object width, height, and length Left-handed coordinate system  x positive to the right Right-handed coordinate system (default for Java)  x positive to the left or z positive toward the viewer Bina Nusantara Y X Z Y X Z Y X Z

5 Object Coordinates Geometric center  the point in object where x,y, and z are all zero in values, usually located inside the object. Object coordinates start from its geometric center Bina Nusantara Y X Z

6 World Coordinates Coordinates that shows how the objects are located in relation to the 3D world they are in Bina Nusantara X Z Y

7 3D Model Vertices (Vertex for singular)  corner points of an object Edges  lines which connect the vertices Bina Nusantara Vertex Edge Hidden line Surface/face Hidden surface

8 3D Polygon A closed figure created by three or more vertices connected with edges Simplest polygon  triangle Complex 3D shapes can be decomposed into a collection of triangles, commonly called a mesh Bina Nusantara

9 Displaying 3D Model 2D Rendering 3D Rendering Transformation Modeling Create 3D model in object space Convert to world space coordinates Convert to view coordinates Convert to screen coordinates Bina Nusantara commonly called "eye space" or "camera space”. Objects are converted to view space to know what is visible on the screen. project the view coordinates into 2D coordinates that map directly to viewport (window or rectangle which limits the visibility of 3D world).

10 3D Transformation Position (translation) Size (scaling) Orientation (rotation) Shapes (shear) Bina Nusantara x’ y’ z’ 1 1 0 0 tx 0 1 0 ty 0 0 1 tz 0 0 0 1 xyz1xyz1 = * X Z t

11 Rendering Process of converting the 3D model into an on-screen 2D image Bina Nusantara Calculate the appearance of object’s different faces Convert faces into a 2D form Send the result to the video card

12 3D Rendering Techniques Flat shading Lambert shading Gouraud shading Phong shading Texture mapping Bump mapping Cel shading Raytracing Radiosity And so on … Bina Nusantara

13 Scene Graph Maintains information about all entities in the 3D world in structures called nodes Group nodes contain information about themselves and point to other nodes (descendants) Leaf nodes contain only information about themselves and have no children Bina Nusantara

14 Scene Graph Bina Nusantara Scene Terrain Player1 Land LightingGeometryTransform Sea LightingTransform Sky LightingTransform Player2 Man LightingGeometryTransformAudio Man LightingGeometryTransformAudio

15 Java 3D API Enables the creation of three-dimensional graphics applications and Internet-based 3D applets. Provides high-level constructs for creating and manipulation 3D geometry and building the structures used in rendering that geometry. Bina Nusantara

16 Sample Code Bina Nusantara Create 3D canvas Create The 3D World

17 Sample Code Bina Nusantara Create Background The 3D World

18 Sample Code Bina Nusantara Prepare color for the ball Prepare The Texture for the ball

19 Sample Code Bina Nusantara Prepare appearance for the ball by including The color and Texture Create The ball

20 Sample Code Bina Nusantara Prepare PointLight for lightning effect

21 Sample Code Bina Nusantara Adding component to The Universe

22 Sample Code Bina Nusantara Setting action for application

23 Sample Code Bina Nusantara Rotate The Ball Result

24 References Java 3D API Tutorial. 2009. http://java.sun.com/developer/onlineTraining/java3d/ http://java.sun.com/developer/onlineTraining/java3d/ 3D Game Programming All in One. Finney, Kenneth C. 2004. Ch 3. 3D Basic. 1999. http://www.gamedev.net/reference/articles/article673.asp http://www.gamedev.net/reference/articles/article673.asp Graphics Pipeline. 2000. http://www.arch.ttu.edu/visualization/5347- Digital_VIZ/VideoLectures/PptLecturePdfs/GraphicsPipelineAlgorith mic_12sep08.pdfhttp://www.arch.ttu.edu/visualization/5347- Digital_VIZ/VideoLectures/PptLecturePdfs/GraphicsPipelineAlgorith mic_12sep08.pdf Java 3D Tutorial. 2001. http://www.java3d.org/tutorial.htmhttp://www.java3d.org/tutorial.htm Combining Rotation and Translation in Java 3d. 2009. http://www.developer.com/java/other/article.php/3712226 http://www.developer.com/java/other/article.php/3712226 Creating a 3D Universe with Java3D. 1998. http://www.acm.org/crossroads/xrds5-2/ovp52.html http://www.acm.org/crossroads/xrds5-2/ovp52.html Bina Nusantara


Download ppt "3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0."

Similar presentations


Ads by Google