Scene Graph & Game Engines. 2 Limitations of Immediate Mode Graphics  When we define a geometric object in an application, upon execution of the code.

Slides:



Advertisements
Similar presentations
2D Geometric Transformations
Advertisements

1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Building Models modified by Ray Wisman Ed Angel Professor of Computer Science,
1 Building Models. 2 Objectives Introduce simple data structures for building polygonal models ­Vertex lists ­Edge lists OpenGL vertex arrays.
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Concept of Modeling Model -- The representation of an object or a system Modeling -- The creation and manipulation of an object or a system representation.
Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Graphical Objects and Scene Graphs CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
Hierarchical Transformations Hierarchical Models Scene Graphs
Hierarchy, Modeling, and Scene Graphs Angel: Chapter 10 OpenGL Programming and Reference Guides, other sources. ppt from Angel, AW, etc. CSCI 6360/4360.
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
C O M P U T E R G R A P H I C S Stuff CMSC 435 / 634 Transformations 1/29 Geometric Transformations Readings: Chapters 5-6.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Chapter 10 Bresenham’s Algorithm Data Structures and Graphics or Working with Models.
Graphical Objects and Scene Graphs 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Demetriou/Loizidou – ACSC330 – Chapter 9 Hierarchical and Object-Oriented Modeling Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
More on Advanced Interfaces, Image Basics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, November 21, 2003.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Kinematics Jehee Lee Seoul National University. Kinematics How to animate skeletons (articulated figures) Kinematics is the study of motion without regard.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Jul 25, 2014IAT 3551 Scene Graphs.  A data structure that stores information about a graphics scene –Each node has information that structures the interpretation.
Lighting Review & Example Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, November 17, 2003.
Control flow for interactive applications CSE 3541 Matt Boggus.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Attack of the Clones Image source:
Graphical Objects and Scene Graphs Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Hierarchical Modeling. 2 Objectives Build a tree-structured model of a humanoid figure. Examine various traversal strategies. Build a generalized tree-model.
Mobile & Casual Gaming OpenGL ES Intro. /red/chapter03.html.
Chapter 1 Graphics Systems and Models Models and Architectures.
CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai.
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
Hierarchical Models Chapter 9.
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
- Introduction - Graphics Pipeline
© University of Wisconsin, CS559 Spring 2004
IAT 355 Scene Graphs Feb 23, 2017 IAT 355.
Graphical Objects and Scene Graphs
Graphical Objects and Scene Graphs
Using the basic-objects-IFS.js Utility
Modeling and Hierarchy
Hierarchical Modeling II
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Modeling and Hierarchy
Hierarchical and Object-Oriented Graphics
Introduction to Computer Graphics with WebGL
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Hierarchical and Object-Oriented Graphics
Hierarchical Modeling I
Game Programming Algorithms and Techniques
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
CSCE 441: Computer Graphics: Hierarchical Models
Presentation transcript:

Scene Graph & Game Engines

2 Limitations of Immediate Mode Graphics  When we define a geometric object in an application, upon execution of the code the object is passed through the pipeline  It then disappears from the graphical system  To redraw the object, either changed or the same, we must reexecute the code  Display lists provide only a partial solution to this problem

3 OpenGL and Objects  OpenGL lacks an object orientation  Consider, for example, a green sphere We can model the sphere with polygons or use OpenGL quadrics Its color is determined by the OpenGL state and is not a property of the object  Defies our notion of a physical object  We can try to build better objects in code using object-oriented languages/techniques

4 Imperative Programming Model  Example: rotate a cube  The rotation function must know how the cube is represented Vertex list Edge list Application Rotate cube data results

5 Object-Oriented Programming Model ApplicationCube Object  In this model, the representation is stored with the object  The application sends a message to the object  The object contains functions (methods) which allow it to transform itself message

6 Cube Object  Suppose that we want to create a simple cube object that we can scale, orient, position and set its color directly through code such as cube mycube; mycube.color[0]=1.0; mycube.color[1]= mycube.color[2]=0.0; mycube.matrix[0][0]=………

7 Cube Object Functions  We would also like to have functions that act on the cube such as mycube.translate(1.0, 0.0,0.0); mycube.rotate(theta, 1.0, 0.0, 0.0); setcolor(mycube, 1.0, 0.0, 0.0);  We also need a way of displaying the cube mycube.render();

8 Building the Cube Object class cube { public: float color[3]; float matrix[4][4]; // public methods private: // implementation }

9 The Implementation  Can use any implementation in the private part such as a vertex list  The private part has access to public members and the implementation of class methods can use any implementation without making it visible  Render method is tricky but it will invoke the standard OpenGL drawing functions

10 Other Objects  Other objects have geometric aspects Cameras Light sources  But we should be able to have nongeometric objects too Materials Colors Transformations (matrices)

11 Application Code cube mycube; material plastic; mycube.setMaterial(plastic); camera frontView; frontView.position(x,y, z);

12 Light Object class light { // match Phong model public: boolean type; //ortho or perspective boolean near; float position[3]; float orientation[3]; float specular[3]; float diffuse[3]; float ambient[3]; }

13 Scene Descriptions  If we recall figure model, we saw that We could describe model either by tree or by equivalent code We could write a generic traversal to display  If we can represent all the elements of a scene (cameras, lights,materials, geometry) as C++ objects, we should be able to show them in a tree Render scene by traversing this tree

14 Scene Graph

15 Preorder Traversal PushAttrib PushMatrix Color Translate Rotate Object1 Translate Object2 PopMatrix PopAttrib …

16 Group Nodes  Necessary to isolate state chages Equivalent to Push/Pop  Note that as with the figure model We can write a universal traversal algorithm The order of traversal can matter  If we do not use the group node, state changes can persist

Open Scene Graph  Inventor  VRML  OpenSG ( A scene graph metaphor on top of OpenGL

Game Engines  Unity 3D:  Unreal Engine:  Unigene Heaven:  CryEngine: oads oads  Ogre 3D: