Computer Graphics Matrix Hierarchies / Animation

Slides:



Advertisements
Similar presentations
Hierarchical Transformation. Summary Alternatively, OpenGL thinks: A transformation updates the coordinate system. For each change, the transformation.
Advertisements

Recursion vs. Iteration The original Lisp language was truly a functional language: –Everything was expressed as functions –No local variables –No iteration.
Chapter 4: Trees Part II - AVL Tree
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Advanced Programming for 3D Applications CE Bob Hobbs Staffordshire university Data Structures for Human Motion Lecture 5.
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
Motion Kinematics – Lecture Series 3 ME 4135 – Fall 2011 R. Lindeke.
Hierarchical Modeling I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi Most slides courtesy.
General Trees and Variants CPSC 335. General Trees and transformation to binary trees B-tree variants: B*, B+, prefix B+ 2-4, Horizontal-vertical, Red-black.
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley.
CAP4730: Computational Structures in Computer Graphics
CSE 473 Dr. Charles B. Owen Fundamentals of 3D Game Development1 Skeletons and Skinning Bones and Skeletons Mesh Skinning.
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
Hierarchical Transformations and Models CSE 3541 Matt Boggus.
Velocities and Static Force
Advanced Graphics (and Animation) Spring 2002
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
Data Structures Arrays both single and multiple dimensions Stacks Queues Trees Linked Lists.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
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.
Computer Graphics Soft Body Animation - Skinning CO2409 Computer Graphics Week 22.
SE 313 – Computer Graphics Lecture 6: Transformations Lecturer: Gazihan Alankuş Please look at the last three slides for assignments (marked with TODO)
Kinematics Jehee Lee Seoul National University. Kinematics How to animate skeletons (articulated figures) Kinematics is the study of motion without regard.
Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.
Character Setup In addition to rigging for character models, rigging artists are also responsible for setting up animation controls for anything that is.
Robot Kinematics: Position Analysis 2.1 INTRODUCTION  Forward Kinematics: to determine where the robot ’ s hand is? (If all joint variables are known)
Computer Graphics Matrix Hierarchies / Animation
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
Computer Graphics Matrices
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
Computer Graphics I, Fall 2008 Hierarchical Modeling I.
Advanced Games Development Physics Engines 2 CO2301 Games Development 1 Week 21.
Robotics Chapter 3 – Forward Kinematics
Velocity Propagation Between Robot Links 3/4 Instructor: Jacob Rosen Advanced Robotic - MAE 263D - Department of Mechanical & Aerospace Engineering - UCLA.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Geometric Transformations for Computer Graphics
Geometric Transformations for Computer Graphics
Chapter 8: Recursion Data Structures in Java: From Abstract Data Types to the Java Collections Framework by Simon Gray.
Character Animation Forward and Inverse Kinematics
Spatcial Description & Transformation
Week 7 - Friday CS221.
Manipulator Dynamics 1 Instructor: Jacob Rosen
B+-Trees.
B+-Trees.
Hashing Exercises.
Tonga Institute of Higher Education
Computer Graphics - Hierarchical Models-
Mobile Robot Kinematics
Hierarchical and Object-Oriented Graphics
Applied Algorithms (Lecture 17) Recursion Fall-23
Introduction to Computer Graphics with WebGL
Skeletons and Skinning
GAM 325/425: Applied 3D Geometry
Manipulator Dynamics 2 Instructor: Jacob Rosen
Chapter XIII Character Animation
Geometric Transformations for Computer Graphics
Computer Animation Algorithms and Techniques
A Robust Data Structure
Hierarchical and Object-Oriented Graphics
Lecture 12 CS203 1.
Computer Graphics Module Overview
Hierarchical Modeling & Constructive Solid Geometry
Outline: 5.1 INTRODUCTION
General Trees A general tree T is a finite set of zero or more nodes such that there is one designated node r, called the root of T, and the remaining.
Data Structures & Algorithms
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
General Trees A general tree T is a finite set of one or more nodes such that there is one designated node r, called the root of T, and the remaining nodes.
Presentation transcript:

Computer Graphics Matrix Hierarchies / Animation CO2409 Computer Graphics Week 21

Lecture Contents Model Animation Model/Matrix Hierarchies Limitations of Hierarchies Rendering a Model Hierarchy Matrix Stacks Process

Model Animation So far we have looked at individual models: Each a fixed piece of geometry No moving parts We have animated these models in a way: By moving and rotating them each frame However, now we will focus on manipulating (animating) geometry that is: Made of several rigid parts (this lecture) Flexible with an underlying skeleton (next lecture)

Rigid Body Animation We start with models made up of several rigid parts that can move with respect to each other Mainly mechanical models, such as vehicles, doors, guns, robots… A common assumption for such models is that the parts form a hierarchy A tree structure defining how the parts are connected We will call each part in a tree, a node

Limitations of Hierarchies Most multi-part objects fit naturally into a hierarchical form In particular it’s usually easy to determine a root node for the object But consider a bicycle chain – which link is the root? A hierarchical form also assumes that each node has only one parent that directly controls its movement Not true when multiple forces involved Train carriage with two engines Two people carrying a stretcher Need more complex solution for these cases Use a “solver” – part of a physics engine

Matrix Hierarchies In such a hierarchy: Each node has a parent, or is the root of the tree A node can have any number of children (including 0) Each node in the hierarchy has a world matrix Defining its position and orientation - just like a model However, the world matrix for each node is stored relative to its parent So each node is defined in the local space of its parent Root is stored in absolute world space Implies that child nodes inherit their parent’s movement

Matrix Hierarchy: Diagram Such hierarchies are sometimes called Matrix Hierarchies or Transform Hierarchies

Building Hierarchies The position of a child’s origin determines where it will pivot relative to its parent The orientation of its axes will determines how it will rotate (in X, Y and Z) So the node’s matrix defines the joint with its parent Must ensure that we build the hierarchies and position matrices correctly To allow required animation Actually this is an issue for the 3D artist to resolve

Rendering Hierarchies We want to render a hierarchy of model nodes We need absolute world matrices for each node rather that the parent-relative world matrix that is stored Can simply make the existing rendering code recursive – the code for each node is: Get this node’s absolute world matrix by combining its relative matrix with the parent’s absolute world matrix Render node with its absolute matrix Repeat process for each child part This process dictates a depth-first traversal of the hierarchy tree structure To pass matrices from parent to child easily (see lab)

Rendering Hierarchies: Matrix Stack Recursion may be inefficient for a real-world app that has many 100s or 1000s of models with many parts A human model may have 50 or 60 parts Each function call adds additional code to transfer control to the new function and return back again. Not usually an issue, but games often need optimisation. We can convert this recursive process to an iterative one Instead of using recursion, we use a single loop The key is to realise that the recursion here is only used to pass the parent’s matrix down to the children. Instead, just have the nodes point to their parents.

Rendering Hierarchies Efficiently Put nodes into a list (actually a vector or array) Use depth-first order Done in advance Each part has its parent-relative matrix In the example will use M0, M1 etc. Also each node knows its parent

Rendering Hierarchies Example Each part needs to know its absolute matrix for rendering This is its own relative matrix * parent’s absolute matrix Same as recursive method But we can get the parent’s absolute matrix directly Since we have a reference to the parent And the parent has already been rendered earlier in the list No need for recursion