IAT 355 Scene Graphs Feb 23, 2017 IAT 355.

Slides:



Advertisements
Similar presentations
Computer Graphics 2D & 3D Transformation.
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.
Lab 1: OpenGL Tutorial CS 282. What’s the plan for today? Go over our framework code. Learn some basic OpenGL! Reveal Lab 1 Answer questions.
Transformations IV Week 3, Wed Jan 23
Hierarchical Modeling II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Alyce Brady CS 510: Computer Algorithms Depth-First Graph Traversal Algorithm.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Transformations III Week.
Graphical Objects and Scene Graphs CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
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
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Hierarchy, Modeling, and Scene Graphs Angel: Chapter 10 OpenGL Programming and Reference Guides, other sources. ppt from Angel, AW, etc. CSCI 6360/4360.
COMP 175: Computer Graphics March 10, 2015
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.
COS 397 Computer Graphics Assoc. Prof. Svetla Boytcheva AUBG 2013 COS 397 Computer Graphics Practical Session №1 Introduction to OpenGL, GLFW and CG.
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.
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.
Interactive Computer Graphics CS 418 – Spring 2015 Mesh Rendering, Transformation, Camera Viewing and Projection in OpenGL TA: Zhicheng Yan Sushma S Kini.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
Week 4 Lecture 1: Hierarchical Modeling Part 1 Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E ©
Hierarchical Modeling. Instance Transformation Start with a prototype object (a symbol) Each appearance of the object in the model is an instance – Must.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 40 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 40 Computer Graphics Hierarchy I.
CS559: Computer Graphics Lecture 15: Hierarchical Modeling and Shading Li Zhang Spring 2008.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Jul 25, 2014IAT 3551 Scene Graphs.  A data structure that stores information about a graphics scene –Each node has information that structures the interpretation.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Transformations Tutorial
Computer Graphics I, Fall 2008 Hierarchical Modeling II.
Scene Graph & Game Engines. 2 Limitations of Immediate Mode Graphics  When we define a geometric object in an application, upon execution of the code.
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
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.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
Computer Graphics I, Fall 2010 Building Models.
Computer Graphics I, Fall 2008 Hierarchical Modeling I.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai.
Hierarchical Models Chapter 9.
Computer Graphics Overview
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Graphical Objects and Scene Graphs
Graphical Objects and Scene Graphs
Using the basic-objects-IFS.js Utility
Modeling and Hierarchy
Computer Graphics - Hierarchical Models-
Modeling and Hierarchy
Hierarchical and Object-Oriented Graphics
Introduction to Computer Graphics with WebGL
Building Models Ed Angel
CSCE 441: Computer Graphics: Hierarchical Models
Isaac Gang University of Mary Hardin-Baylor
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Hierarchical and Object-Oriented Graphics
Hierarchical Modeling I
Transformations III Week 3, Mon Jan 21
Transformations IV Week 3, Wed Jan 23
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
Hierarchical Modeling
CSCE 441: Computer Graphics: Hierarchical Models
Presentation transcript:

IAT 355 Scene Graphs Feb 23, 2017 IAT 355

Scene Graphs A data structure that stores information about a graphics scene Each node has information that structures the interpretation of child nodes Feb 23, 2017 IAT 355

Computer Graphics In Processing we use immediate mode graphics When we define a geometric object: Call its drawing code glPushMatrix() glBegin( GL_TRIANGLES ); glVertex3f( 1.0, 2.0, 3.0 ); ... glEnd(); glPopMatrix(); Feb 23, 2017 IAT 355

Immediate Mode Graphics objects are not retained once they are drawn To redraw the scene, must reexecute the code Makes sense, because the screen needs redrawing when new info arrives Feb 23, 2017 IAT 355

OpenGL and Objects OpenGL has a weak notion of objects Eg. Consider a red cube Model the cube with squares Color is determined by OpenGL state (current color, current lighting) Not really an object Feb 23, 2017 IAT 355

Imperative Programming Model Example: rotate the cube Application sends cube data to the graphics subsystem The graphics subsystem maintains state Current rotation, translation... The rotate function must know how the cube us represented Vertex list Edge list Feb 23, 2017 IAT 355

Object Oriented Graphics In OO graphics, the representation is stored with the model The application sends updates to the cube model, which stores state such as transformation, color The object contains functions that allow it to transform itself Feb 23, 2017 IAT 355

Java The obvious means to do this is to store objects in instances of classes Methods do transformation and trigger drawing calls Feb 23, 2017 IAT 355

Cube object Create an object that allows us to store rotation, translation, color... Cube myCube ; myCube.color[0] = 1.0 ; myCube.color[1] = 0.0 ; ... myCube.matrix [0][0] = 1.0 ; .... Feb 23, 2017 IAT 355

Cube object functions Also want common functions to act on the cube’s data: myCube.translate( tx, ty, tz ); myCube.rotate( r, 1.0, 0.0, 0.0 ); myCube.setColor( r, g, b); Draw it! myCube.render(); Feb 23, 2017 IAT 355

class cube { public: private: } float color [3] ; float matrix[4][4] ; //implementation } Feb 23, 2017 IAT 355

The Implementation Can choose any old way of representing the cube Vertex list, polygons... Private stuff accesses the public piece Render method makes OpenGL calls Feb 23, 2017 IAT 355

Other Objects Other types of objects are: Also non-geometric things 3D Cameras 3D Lights Also non-geometric things Materials, colors Matrices (storing geometric transformations) Feb 23, 2017 IAT 355

Application cube myCube ; material plastic ; myCube.setMaterial( plastic ); camera frontView; frontView.position( x, y, z ); Feb 23, 2017 IAT 355

Scene Descriptions If you can represent all scene elements as objects Cameras Lights Material Geometry Put it all in a tree and traverse the tree Render scene by traversal Feb 23, 2017 IAT 355

Scene Graph Feb 23, 2017 IAT 355

Scene Graph glPushAttrib glPushMatrix glColor glTranslate glRotate Object1 Object2 glPopMatrix glPopAttrib ... Feb 23, 2017 IAT 355

Scene Graph Traversal Similar to preorder traversal of binary tree Visit a node “Activate” the node -- pushMatrix/Attrib Vist all children in child order “UNActivate” node -- popMatrix/Attrib Feb 23, 2017 IAT 355

Separator nodes Necessary to mark places where attribute changes take place Where the OpenGL push/pop live Advantage: You can write a universal traversal algorithm Traversal order must be predictable In OpenGL, state changes stick around Setting color sticks until the next color change Feb 23, 2017 IAT 355

Scene Graphs There is a very important strategy: Transform Code into a Data Structure What was previously a bunch of OpenGL calls is now: Graph nodes of various kinds Each node type has well-defined rules Feb 23, 2017 IAT 355

Scene Graph Hierarchy Changes to Parent nodes affect all children Translate of a sub-tree moves all of its nodes Specify this large-scale change in one place The scene graph rules handle the rest Feb 23, 2017 IAT 355