Hierarchical Transformations Hierarchical Models Scene Graphs

Slides:



Advertisements
Similar presentations
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
Advertisements

Hierarchical Transformation. Summary Alternatively, OpenGL thinks: A transformation updates the coordinate system. For each change, the transformation.
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
Hierarchical Modeling I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
Graphical Objects and Scene Graphs CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Scenes, Cameras & Lighting. Outline  Constructing a scene  Using hierarchy  Camera models  Light models.
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
Hierarchical Transformations and Models CSE 3541 Matt Boggus.
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.
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.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
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.
Geometric transformations The Pipeline
Transforms Hierarchical Modeling Scene Graphs Using hierarchical modeling techniques in 3D software design Transforms Local basis Matrix math review Matrices.
Demetriou/Loizidou – ACSC330 – Chapter 9 Hierarchical and Object-Oriented Modeling Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
Data Structures for Scenes, The Basics of Scene Graphs Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Friday,
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
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.
1 Scene Graphs ©Anthony Steed Scene Graph Overview n Building Scene Structures n Traversal n Examples n Instancing and Re-Use n More Transformations.
Computing & Information Sciences Kansas State University Lecture 19 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 19 of 42 William H. Hsu.
Kinematics Jehee Lee Seoul National University. Kinematics How to animate skeletons (articulated figures) Kinematics is the study of motion without regard.
1 Scene Graphs Week 4.2 ©Anthony Steed
Jul 25, 2014IAT 3551 Scene Graphs.  A data structure that stores information about a graphics scene –Each node has information that structures the interpretation.
111/16/ :14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 2 – Basic VRML.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, October 31, 2003.
Transformations Tutorial
1/50 CS148: Introduction to Computer Graphics and Imaging Transforms CS148: Introduction to Computer Graphics and Imaging Transforms.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
Computer Graphics I, Fall 2008 Hierarchical Modeling II.
Computer Graphics Matrix Hierarchies / Animation
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
CS559: Computer Graphics Lecture 13: Hierarchical Modeling and Curves Li Zhang Spring 2010.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
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.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D ( ) VRVU.
Hierarchical Models Chapter 9.
IAT 355 Scene Graphs Feb 23, 2017 IAT 355.
Modeling and Hierarchy
Hierarchical Transformations Hierarchical Models Scene Graphs
Computer Graphics - Hierarchical Models-
Modeling and Hierarchy
Hierarchical and Object-Oriented Graphics
Introduction to Computer Graphics with WebGL
CSCE 441: Computer Graphics: Hierarchical Models
Transformations IV Week 3, Wed Jan 20
Projection in 3-D Glenn G. Chappell
Hierarchical and Object-Oriented Graphics
Hierarchical Modeling I
Hierarchical Modeling & Constructive Solid Geometry
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:

Hierarchical Transformations Hierarchical Models Scene Graphs Modeling Hierarchical Transformations Hierarchical Models Scene Graphs

Modeling Objects A prototype has a default size, position, and orientation You need to perform modeling transformations to position it within the scene myCube() - Create a unit cube with its origin at (0,0,0) To create a 2 x 0.1 x 2 table top - need to call glScalef(2, 0.1, 2)

Instance Transformation Start with a prototype object (a symbol) Each appearance of the object in the model is an instance Must scale, orient, position Defines instance transformation

Symbol-Instance Table Can store a model by assigning a number to each symbol and storing the parameters for the instance transformation

Relationships in Car Model Symbol-instance table does not show relationships between parts of model Consider model of car Chassis + 4 identical wheels Two symbols Rate of forward motion determined by rotational speed of wheels

Structure Through Function Calls car(speed) { chassis(speed) wheel(right_front, speed); wheel(left_front , speed); wheel(right_rear , speed); wheel(left_rear , speed); } Fails to show relationships well Look at problem using a graph

Graphs Set of nodes and edges (links) Edge connects a pair of nodes Directed or undirected Cycle: directed path that is a loop loop

Tree Graph in which each node (except the root) has exactly one parent node May have multiple children Leaf or terminal node: no children root node leaf node

Tree Model of Car

DAG Model If we use the fact that all the wheels are identical, we get a directed acyclic graph Not much different than dealing with a tree

Modeling with Trees Must decide what information to place in nodes and what to put in edges Nodes What to draw Pointers to children Edges May have information on incremental changes to transformation matrices (can also store in nodes)

Robot Arm parts in their own coordinate systems robot arm

Articulated Models Robot arm is an example of an articulated model Parts connected at joints Can specify state of model by giving all joint angles

Relationships in Robot Arm Base rotates independently Single angle determines position Lower arm attached to base Its position depends on rotation of base Must also translate relative to base and rotate about connecting joint

Relationships in Robot Arm Upper arm attached to lower arm Its position depends on both base and lower arm Must translate relative to lower arm and rotate about joint connecting to lower arm

Required Matrices Rotation of base: Rb Apply M = Rb to base Translate lower arm relative to base: Tla Rotate lower arm around joint: Rla Apply M = Rb Tla Rla to lower arm Translate upper arm relative to upper arm: Tua Rotate upper arm around joint: Rua Apply M = Rb Tla Rla Tua Rua to upper arm

OpenGL Code for Robot robot_arm() { glRotate(theta, 0.0, 1.0, 0.0); base(); glTranslate(0.0, h1, 0.0); glRotate(phi, 0.0, 1.0, 0.0); lower_arm(); glTranslate(0.0, h2, 0.0); glRotate(psi, 0.0, 1.0, 0.0); upper_arm(); }

Tree Model of Robot Note code shows relationships between parts of model Can change “look” of parts easily without altering relationships Simple example of tree model Want a general node structure for nodes

Scene Graphs Encoding this information in the code is not very productive. Want it to be flexible, data-driven and extensible. Scene-graphs provide this functionality. OpenInventor (http://www.coin3d.org/) Open Scene Graph (http://www.openscenegraph.com/) Many others

Hierarchical Modeling Triangles, parametric curves and surfaces are the building blocks from which more complex real-world objects are modeled. Hierarchical modeling creates complex real-world objects by combining simple primitive shapes into more complex aggregate objects.

Articulated Models

Multiple Components Different Materials

Scene Layout – Worlds

Hierarchical models

Hierarchical models

Hierarchical models

Hierarchical models

Hierarchical models

Hierarchical Grouping of Objects Logical organization of scene fruits chair table ground

Simple Example with Groups numObjects 3 Box { <BOX PARAMS> } Box { <BOX PARAMS> } } numObjects 2 Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } Plane { <PLANE PARAMS> } }

Adding Materials Group { numObjects 3 Material { <BLUE> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } numObjects 2 Material { <BROWN> } Material { <GREEN> } Material { <RED> } Sphere { <SPHERE PARAMS> } Material { <ORANGE> } Sphere { <SPHERE PARAMS> } } } Material { <BLACK> } Plane { <PLANE PARAMS> } }

Adding Transformations

Hierarchical Transformation of Objects Transforms position logical groupings of objects within the scene

Simple Example with Transforms Group { numObjects 3 Transform { ZRotate { 45 } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } } Translate { -2 0 0 } numObjects 2 Box { <BOX PARAMS> } } Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } } Plane { <PLANE PARAMS> } }

Separating types of transformation Note that we have treated translations, rotations, etc. as separate But they are all represented by 4x4 matrices and there is no technical reason not to combine them into the resulting matrix It’s just simpler for the human programmer, and corresponds to the handle of 3D modeling/animation packages

Hierarchical modeling in OpenGL Commands to change current transformation glTranslate, glScale, etc. Affects the state, i.e. all following commands will undergo this transformation Utilities to maintain a matrix stack (to revert to previous state) Difference between model and view matrix

Model vs. Projection matrix It is almost the same to rotate the camera or the objects Main difference: Lighting This is why OpenGL has two transforms: model and projection glMatrixMode( GL_MODELVIEW ); Tells openGL that next matrix commands deal with the objects. typically used for modeling & animation glMatrixMode(GL_PROJECTION); Tells OpenGL we deal with the camera space ( typically used to change viewpoint & focal length

Managing the state To reset everything: glLoadIdentity(); OpenGL stores a stack of matrices You don’t need to remember, OpenGL remembers glPushMatrix() glPopMatrix

Managing the state Push matrix when you start rendering a group Pop once you are done

Scene Graph Convenient Data structure for scene representation Transformations Materials, color Multiple instances Basic idea: Hierarchical Tree Useful for manipulation/animation Especially for articulated figures Useful for rendering too Multi-pass rendering, occlusion culling

Scene Graphs Basic idea: Tree Comprised of several node types: Shape: 3D geometric objects Transform: Affect current transformation Property: Appearance, texture, etc. Group: Collection of subgraphs

Traversal Depth first Top to bottom, left to right

Traversal State The State is updated during traversal Transformations, properties Influence of nodes can be complex E.g. bottom to top

Other Scene Nodes Switch or Selector Nodes Sequence Nodes Level of detail Different rendering styles Damaged v. undamaged states Sequence Nodes Animated sequence Objects Textures Transformations

Object Following or Tethering Can attach an object to the node of another object (or group them in a parent node. Provide an offset to have the other object tag along with the object under control.

Camera Tethering Many times, we want the camera to follow an entity. Need to get the coordinate frame for the entity. Traverse the scene graph to the entity. Or, need to get the current camera system Attach camera and determine transformations to the root of the scene graph.