Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Similar documents
Hierarchical Modeling and Scene Graphs

Hierarchical Modeling and scene graphs

Hierarchy I. Guoying Zhao 1 / 40

Hierarchical Modelling

Hierarchical Modeling and Scene Graphs

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Hierarchical Modeling

Hierarchical Models Week 9, Lecture 19

Computer Graphics (CS 543) Lecture 6a: Hierarchical 3D Models. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Hierarchical Modeling. CS 432 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

6.837 Computer Graphics Hierarchical Modeling Wojciech Matusik, MIT EECS Some slides from BarbCutler & Jaakko Lehtinen

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

Hierarchical Modeling I. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Using GLU/GLUT Objects

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

CS354 Computer Graphics Character Animation and Skinning

TIEA311 Tietokonegrafiikan perusteet kevät 2018

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

Lecture 08: Hierarchical Modeling with Scene Graphs

Scene Graphs. COMP 575/770 Fall 2010

COMP 175 COMPUTER GRAPHICS. Lecture 07: Scene Graph. COMP 175: Computer Graphics March 10, Remco Chang 07 Scene Graph

Hierarchical Modeling. CS 432 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Where We Are: Static Models

Transforms 1 Christian Miller CS Fall 2011

CS 4204 Computer Graphics

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013

Transformation Hierarchies. CS 4620 Lecture 5

Computer graphics MN1

Game Programming. Bing-Yu Chen National Taiwan University

Transformations. Rotation and Scaling

2D/3D Geometric Transformations and Scene Graphs

Graphics and Visualization

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks,

TIEA311 Tietokonegrafiikan perusteet kevät 2017

Outline. Introduction Surface of Revolution Hierarchical Modeling Blinn-Phong Shader Custom Shader(s)

OUTLINE. Hierarchical Models Z-Fighting Primitives Besides Triangles Back Face Culling

CS 465 Program 4: Modeller

OpenGL: Setup 3D World

Computer Graphics. Prof. Feng Liu. Fall /21/2016

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

MODELING AND HIERARCHY

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

Modeling with Transformations

CHAPTER 1 Graphics Systems and Models 3

Hierarchical Modeling II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Maya Lesson 3 Temple Base & Columns

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Using GLU/GLUT Objects. GLU/GLUT Objects. glucylinder() glutwirecone() GLU/GLUT provides very simple object primitives

3.2 Hierarchical Modeling

Computer Graphics Hands-on

Computer Graphics Geometric Transformations

This week. CENG 732 Computer Animation. Warping an Object. Warping an Object. 2D Grid Deformation. Warping an Object.

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

Chapter 3: Modeling Transformation

Transformations IV. Week 3, Wed Jan 20

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1

Introduction to 3D Graphics with OpenGL. Z-Buffer Hidden Surface Removal. Binghamton University. EngiNet. Thomas J. Watson

CS 591B Lecture 9: The OpenGL Rendering Pipeline

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

CSC 470 Computer Graphics

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

CSE 167: Introduction to Computer Graphics Lecture 11: Scene Graph 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Precept 2 Aleksey Boyko February 18, 2011

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

Lecture 5b. Transformation

Transformations in Ray Tracing. MIT EECS 6.837, Durand and Cutler

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Hierarchical Models Josef Pelikán & Alexander Wilkie CGG MFF UK Praha

Graphics pipeline and transformations. Composition of transformations

Graphical Objects and Scene Graphs

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

Transformations. CSCI 420 Computer Graphics Lecture 4

Due: Thursday, February 6 th, 11:59 pm TA: Mason Remy

Hierarchical Models. Roadmap. Importance of shadows. Importance of shadows. Importance of shadows. Importance of shadows

Hierarchical Modeling

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Introduction to OpenGL

HIERARCHICAL TRANSFORMATIONS A Practical Introduction

Rendering Pipeline and Coordinates Transforms

Hidden Surface Removal. 3D Graphics with OpenGL. Back-Face Culling

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

Speeding up your game

Cheating: In case of cheating, all parts involved (source(s) and receiver(s)) get zero.

OpenGL Transformations

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Chapter 5 - The Scene Graph

RASTERISED RENDERING

Computer Graphics I Lecture 11

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation

we now have a good understanding of 3d representations, rigid body transforms, camera projections, and the fixed function steps in graphics

Transformations IV. Week 3, Mon Jan 22

Adaptive Point Cloud Rendering

CS451Real-time Rendering Pipeline

Computer Graphics. Chapter 7 2D Geometric Transformations

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

Transcription:

Modeling Objects Modeling Hierarchical Transformations Hierarchical Models Scene Graphs 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() wheel(right_front); wheel(left_front); wheel(right_rear); wheel(left_rear); } 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 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 loop 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 robot arm parts in their own coordinate systems

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: R b Apply M = R b to base Translate lower arm relative to base: T la Rotate lower arm around joint: R la Apply M = R b T la R la to lower arm Translate upper arm relative to upper arm: T ua Rotate upper arm around joint: R ua Apply M = R b T la R la T ua R ua 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 realworld 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

fruits Hierarchical Grouping of Objects Logical organization of scene table ground chair Simple Example with Groups numobjects 3 numobjects 3 } numobjects 2 } Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } Plane { <PLANE PARAMS> } } Adding Materials numobjects 3 Material { <BLUE> } numobjects 3 } 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 numobjects 3 Transform { ZRotate { 45 } numobjects 3 } } Transform { Translate { -2 0 0 } numobjects 2 } 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 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.