Hierarchical Modeling & Constructive Solid Geometry

Slides:



Advertisements
Similar presentations
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Advertisements

Links and Joints.
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.
Animation. Outline  Key frame animation  Hierarchical animation  Inverse kinematics.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Hierarchical Transformations and Models CSE 3541 Matt Boggus.
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
2IV60 Computer graphics set 4:3D transformations and hierarchical modeling Jack van Wijk TU/e.
Advanced Graphics (and Animation) Spring 2002
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
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
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.
1 Animation & Java3D ©Anthony Steed Overview n Introduction to Animation Kinematics Dynamics Boids n Java3D Scene graph Animation Vehicles.
Chapter 2 Robot Kinematics: Position Analysis
Geometric Transforms Changing coordinate systems.
Defining complex objects Dr Nicolas Holzschuch University of Cape Town Modified by Longin Jan Latecki.
Data Structures for Scenes, The Basics of Scene Graphs Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Friday,
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.
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
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Visual Computing Geometric Modelling 1 INFO410 & INFO350 S2 2015
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
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.
Management Information Systems
Transformations Tutorial
Computer Graphics Matrix Hierarchies / Animation
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
CS559: Computer Graphics Lecture 13: Hierarchical Modeling and Curves Li Zhang Spring 2010.
Hierarchical Modeling.  Explain the 3 different types of model for which computer graphics is used for.  Differentiate the 2 different types of entity.
Computer Graphics I, Fall 2008 Hierarchical Modeling I.
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.
CS552: Computer Graphics Lecture 28: Solid Modeling.
Hierarchical Models Chapter 9.
Constructive Solid Geometry CSG (Geometri Padat Konstruktif)
Modeling and Hierarchy
Hierarchical Modeling II
3D Object Representations
Hierarchical Transformations Hierarchical Models Scene Graphs
structures and their relationships." - Linus Torvalds
Computer Graphics - Hierarchical Models-
Modeling and Hierarchy
Hierarchical and Object-Oriented Graphics
More Graph Algorithms.
Introduction to Computer Graphics with WebGL
CSCE 441: Computer Graphics: Hierarchical Models
Hierarchical and Object-Oriented Graphics
Hierarchical Modeling I
Geometric Objects and Transformations (II)
Transformations III Week 3, Mon Jan 21
S.JOSEPHINE THERESA, DEPT OF CS, SJC, TRICHY-2
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
Hierarchical Modeling
Computer Graphics Matrix Hierarchies / Animation
structures and their relationships." - Linus Torvalds
Figure 3. Converting an expression into a binary expression tree.
CSCE 441: Computer Graphics: Hierarchical Models
Presentation transcript:

Hierarchical Modeling & Constructive Solid Geometry COM337 COMPUTER GRAPHICS Hierarchical Modeling & Constructive Solid Geometry

Introduction When defining a complex object or system, it is easier to first specify the subparts, then, describe how the subparts come together E.g., a bicycle can be described by first describing a frame, wheels, fenders, handlebars, seat, chain, and pedals then positioning these components to form the bicycle

Basic Modeling Concepts Modeling is the creation and manipulation of a system representation A representation of a system is called a model of the system A model can be graphical or purely descriptive (such as a set of equations that describe relationships of system parameters) Graphical models are often called geometric models We will use the term “model” mostly to mean a geometric model

System Representations The example graphical representation of a logic circuit on the right illustrates features common to many system models Component parts are shown as geometric structures (symbols) Relationships between symbols are represented with a network of connecting lines

System Representations Repeated positioning of a few basic symbols (such as the two and gate symbols) is a common method for building complex models Each such occurrence of a symbol in a model is called an instance of that symbol In many cases symbols are dictated but in other cases symbols can be any convenient geometric pattern

System Representations The information needed to construct and manipulate a model can be stored in data structures, and/or can be specified with procedures In general, a model specification will contain both data structures and procedures, although some models are defined completely with data structures and others use only procedural specifications In solid modeling, information from data structures (defining coordinates and other things) is used with few procedures On the other hand, a weather model may need mostly procedures to calculate plots of temperature and pressure variations.

Symbol Hierarchies Many models can be organized as a hierarchy of symbols Basic elements for the model can be used to form composite objects (modules), which themselves can be grouped to form higher level objects, and so on …

Hierarchical Models Suppose that we wish to build a model of an automobile that we can animate The model can be composed of 5 parts (the chassis and the four wheels) each of which is described using standard primitives

Hierarchical Models 2 frames of a simple animation of the model are shown below We can write a program to generate this animation by noting that if each wheel has a radius r, then a 360-degree rotation of a wheel corresponds to the car moving forward (or backward) a distance of 2πr Program could contain one function to generate each wheel and another to generate the chassis All functions could use the same input such as the desired speed and direction of the car

Hierarchical Models This program is just the kind that we do NOT want to write It is linear and does not show the relationships among the components of the car There are 2 relationships that we want to exploit We cannot separate the movement of the car from the movement of the wheels All wheels are identical and merely located in different places with different orientations

Hierarchical Models

Hierarchical Models

Stack-Based Traversal in Application Code Imagine that we will use a function called figure to do the drawing The MV matrix, M, when this function is called will determine the position of the figure The root node (first node) will draw the torso (using M) Next node is the head: function head will be called with MV updated to MMh Then, as we continue with left-upper arm, left-lower arm, right arm, left leg, and right leg, MV will be updated to MMlua, MMluaMlll, Mrua, …

Stack-Based Traversal in Application Code After processing a node, if we go back up to its parent, we need to also roll back the transformation matrix. This can easily be done by making use of a stack to store (push) copies of matrices and by recovering with popping. Our code will have transformations mixed with pushes and pops of the MV matrix

Stack-Based Traversal in Application Code var modelViewMatrix = mat4(); var mvStack = [ ]; function figure() { mvStack.push(modelViewMatrix); torso(); modelviewMatrix = mult(modelViewMatrix, translate); modelViewMatrix = mult(modelViewMatrix, rotate); head(); modelViewMatrix = mvStack.pop(); leftUpperArm(); modelViewMatrix = mvStack.pop(); mvStack.push(modelViewMatrix); modelviewMatrix = mult(modelViewMatrix, translate); modelViewMatrix = mult(modelViewMatrix, rotate); leftLowerArm(); rightUpperArm(); ⁞

Stack-Based Traversal in Application Code function torso() { instanceMatrix = mult(modelViewMatrix, translate(0.0, 0.5*torsoHeight, 0.0)); mult(instanceMatrix, scale4(torsoWidth, torsoHeight, torsoWidth)); gl.uniformMatrix4fv( modelViewMatrixLoc, false, flatten(instance)); for (var i = 0; i < 6; ++i) { gl.drawArrays(gl.TRIANGLE_FAN, 4*i, 4); } Functions for individual parts can be as on the right The textbook first explains a simpler example for a robot arm with 3 parts Have a look at that example first and try to complete this hierarchical model If you can complete it, you already have the code for one of the bonuses in the 2nd assignment

Stack-Based Application Code vs. Alternative The example approach has limitations The code relies on programmer to deal with stacks (push and pops) The code developed for the example object will not easily extend to another object Building the model and rendering it is all together, we’d prefer to separate them A more general and powerful method to work with hierarchies is to implement the tree as a data structure and to render it with a traversal algorithm (See textbook)

Hierarchical Models Summary Combine smaller/simpler shapes to construct complex objects and scenes Stored in trees or similar data structures Operations are based on traversal of the tree Can keep other information together with the geometry in tree such as transformations, attributes, bounding boxes, etc.

Scene Graphs Directed Acyclic Graphs (DAGs) to represent scenes and complex objects Nodes: Grouping nodes, Transform nodes, Level of Detail (LoD) nodes, Attribute nodes, State nodes Leaves: Geometric object descriptions

Constructive Solid Geometry (CSG) Combine multiple shapes with set operations (intersection, union, set difference) to construct new shapes

CSG

Implementing CSG Ray casting methods are used for rendering and finding properties of volumes constructed with CSG Rays are intersected with objects Intersections are sorted according to the distance Depending on the operation, extents of the new object can be found

Implementing CSG Ray casting methods are used for rendering and finding properties of volumes constructed with CSG Rays are intersected with objects Intersections are sorted according to the distance Depending on the operation, extents of the new object can be found