CSCE 441: Computer Graphics: Hierarchical Models

Slides:



Advertisements
Similar presentations
CSE 457 Modeler Help Session Lovingly brought to you by: TA Steve.
Advertisements

Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Jinxiang Chai CSCE441: Computer Graphics Coordinate & Composite Transformations 0.
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.
Objectives Learn to build arbitrary transformation matrices from simple transformations Learn to build arbitrary transformation matrices from simple transformations.
Hierarchical Modeling II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
2IV60 Computer Graphics 2D transformations
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.
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:
Graphical Objects and Scene Graphs 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
Geometric Transformations Jehee Lee Seoul National University.
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.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
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.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Hierarchical and Object-Oriented Graphics Construct complex models from a set of simple geometric objects Extend the use of transformations to include.
Transformations Tutorial
1/50 CS148: Introduction to Computer Graphics and Imaging Transforms CS148: Introduction to Computer Graphics and Imaging Transforms.
Computer Graphics I, Fall 2008 Hierarchical Modeling II.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
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.
Composing Transformations
CS559: Computer Graphics Lecture 12: OpenGL - Transformation Li Zhang Spring 2008.
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.
Jinxiang Chai CSCE441: Computer Graphics Coordinate & Composite Transformations 0.
CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai.
Transformation Example. Order of Transformation Matters Scale, translate Scale, translate Translate scale Translate scale Rotate, Translate Rotate, Translate.
Hierarchical Models Chapter 9.
IAT 355 Scene Graphs Feb 23, 2017 IAT 355.
Summary of Properties of 3D Affine Transformations
Graphical Objects and Scene Graphs
Modeling and Hierarchy
Hierarchical Modeling II
Hierarchical Transformations Hierarchical Models Scene Graphs
Computer Graphics - Hierarchical Models-
Modeling and Hierarchy
Hierarchical and Object-Oriented Graphics
Introduction to Computer Graphics with WebGL
Hierarchical and Object-Oriented Graphics
Hierarchical Modeling I
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Transformations in OpenGL
Hierarchical Modeling & Constructive Solid Geometry
CSCE441: Computer Graphics Coordinate & Composite Transformations
Geometric Objects and Transformations (II)
Transformations III Week 3, Mon Jan 21
CSCE441: Computer Graphics 2D/3D Transformations
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:

CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai

Summary: 3D Geometry Pipeline Object space World space View space Normalized project space Image space 2

Complex Models

Outline Hierarchical Models Reading: HB 9-8&9-9, HB chapter 11, OpenGL Programming Guide, chapter 3, and course slides

Symbols and Instances Most graphics API supports a few primitives: - sphere - cube - cylinders These symbols are instanced using instance/model transformation:

What’s the matrix for the instance transformation above? Symbols and Instances Most graphics API supports a few primitives: - sphere - cube - cylinders These symbols are instanced using instance transformation: What’s the matrix for the instance transformation above?

Symbols and Instances Most graphics API supports a few primitives: - sphere - cube - cylinders These symbols are instanced using instance transformation:

Sample Instance Trans. In opengl, instance/model transformation is created by modifying the Model-view matrix: glMatrixMode(GL_MODELVIEW); glLoadIdentity(…);// set current matrix to the identity glTranslate(…); // translate glRotate(…); //rotate glScale(…);//scale house();

Sample Instance Trans. In opengl, instance transformation is created by modifying the Model-view matrix: glMatrixMode(GL_MODELVIEW); glLoadIdentity(…); glTranslate(…); glRotate(…); glScale(…); house(); Does the transform seem to be backward?

Composite Transformation: Opengl Implementation Opengl postmultiplies transformation matrices as they are called Each subsequent transformation call concatenates the designated transformation matrix on the right of the composite matrix We must invoke the transformation in the opposite order from which they are applied. glMatrixMode(GL_MODELVIEW); glLoadIdentity(…); M4; M3; M2; M1; …

Lamp What’s the current coordinate A ? 11

Lamp Suppose we know how to draw each bone in local reference frames

Lamp How can we draw the character under a particular pose

Lamp What’s the current coordinate A ? 14

Lamp What’s the current coordinate A ? 15

Lamp What’s the current coordinate A ? 16

Lamp What’s the current coordinate A ? 17

Lamp Implementation The lamp can be displayed by computing a global matrix and computing it at each step lamp() { M_model = base(); upper_arm(); middel_arm(); lower_arm(); } Matrix M_model; Main() { … M_model=Identity() lamp(); } 18

Lamp Implementation The lamp can be displayed by computing a global matrix and computing it at each step lamp() { M_model = base(); upper_arm(); middel_arm(); lower_arm(); } Matrix M_model; Main() { … M_model=Identity() lamp(); } Can we make it more efficiently? 19

Better Implementation Instead of recalculating the global matrix each time, we can just update it in place lamp() { M_model *= base(); upper_arm(); middel_arm(); lower_arm(); } Matrix M_model; Main() { … M_model=Identity() lamp(); } 20

Opengl Implementation Opengl maintains a global state matrix called model-view matrix Main() { … glMatrixMode(GL_MODELVIEW); glLoadIdentity(); 2D_lamp(a,b,c,d,e,f) } 2D_lamp(x, y, θ0, θ1, θ2, θ3) { glTranslatef(x,y,0) glRotatef(θ0,0,0,1,); base(); glTranslatef(0,l0,0) glRotatef(θ1,0,0,1,); upper_arm(); glTranslatef(0,l1,0) glRotatef(θ2,0,0,1,); middel_arm(); glTranslatef(0,l2,0) glRotatef(θ3,0,0,1,); lower_arm(); } //set current matrix to identity

Hierarchical Modeling Consider a model of a car – how many symbols? – how many instances?

Hierarchical Modeling Consider a model of a car – 2 symbols : – 5 instances : 23

Hierarchical Modeling Chasis system Consider a model of a car – 2 symbols : chassis + wheel – 5 instances : 1 chassis + 4 wheel World system front-left wheel system 24

Hierarchical Modeling Consider a model of a car – 2 symbols : chassis + wheel – 5 instances : 1 chassis + 4 wheel We can represent our car as a tree to show the relationship between the parts - tree nodes store subparts - transition edges represent relationship between the parts

Hierarchical Modeling Consider a model of a car – 2 symbols : chassis + wheel – 5 instances : 1 chassis + 4 wheel We can represent our car as a tree to show the relationship between the parts However, since all 4 wheels are instances of the same model, we’d like to only have that model appear once

Hierarchical Modeling Hierarchical model can be composed of instances using trees or directed acyclic graphs (DAGs) - edges contains geometric transformations - nodes contains geometry of subparts

Hierarchical Modeling Hierarchical model can be composed of instances using trees or directed acyclic graphs (DAGs) - edges contains geometric transformations - nodes contains geometry of subparts What might we draw the tree for the lamp?

Hierarchical Modeling Hierarchical model can be composed of instances using trees or directed acyclic graphs (DAGs) - edges contains geometric transformations - nodes contains geometry

Hierarchical Modeling Hierarchical model can be composed of instances using trees or directed acyclic graphs (DAGs) - edges contains geometric transformations - nodes contains geometry world base Upper arm middle arm lower arm 30

A More Complex Example: Human Figure torso

A More Complex Example: Human Figure torso 32

A More Complex Example: Human Figure torso What’s the most efficient way to draw this figure?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree? 34

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

A More Complex Example: Human Figure torso What’s the most sensible way to traverse this tree?

Opengl Implementation: Human Figure torso Mh Mlua Mlla 44

Opengl Implementation: Human Figure torso Mh Mlua Mlla Is this correct? 45

Opengl Implementation: Human Figure torso Mh Mh*Mlua should be Mlua Mh*Mlua*Mlla should be Mlua*Mlla Is this correct? No 46

Matrix Stack glMatrixMode(GL_MODELVIEW) - Initially, each of the stacks contains one matrix, an identity matrix. - The top matrix in the stack is “current matrix” - The depth is at least 32 Mc … I

Push and Pop the Current Matrix glPushMatrix() copy the current matrix at the top of the stack Mc Mc … Mc I … I

Push and Pop the Current Matrix glPopMatrix() destroies the matrix at the top of stack Mtop Mtop-1 Mtop-1 … … I I

Opengl Implementation: Human Figure

Opengl Implementation: Human Figure Mh Mlua Mlua Mlla 51

Articulated Models