Advanced Programming for 3D Applications CE00383-3 Bob Hobbs Staffordshire university Data Structures for Human Motion Lecture 5.

Slides:



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

Links and Joints.
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Forward and Inverse Kinematics CSE 3541 Matt Boggus.
Lecture 2: linear algebra, animation basics
Skeletons CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Character Setup Character Setup is the process of creating handles and controls for anything that a character animator will need to adjust in order to.
Introduction to Robotics
Hierarchical Modeling I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Presentation About Anatomy- Based Joint Models for Virtual Humans Skeletons Prepared By Khloud Zain Al-Abdeen Najwa Al-Ghamdi
Character Animation CSE 191A: Seminar on Video Game Programming Lecture 5: Character Animation UCSD, Spring, 2003 Instructor: Steve Rotenberg.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi Most slides courtesy.
Kinematics. ILE5030 Computer Animation and Special Effects2 Kinematics The branch of mechanics concerned with the motions of objects without regard to.
Hierarchical Modeling II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Skeletons CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Animation CS 551 / 651 Kinematics Lecture 09 Kinematics Sarcos Humanoid.
Serial and Parallel Manipulators
Introduction to 3D Beginner: the class Instructor : Hee Holmen.
Inverse Kinematics (part 1) CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
CSE 473 Dr. Charles B. Owen Fundamentals of 3D Game Development1 Skeletons and Skinning Bones and Skeletons Mesh Skinning.
An Introduction to Robot Kinematics
Hierarchical Transformations Hierarchical Models Scene Graphs
More details and examples on robot arms and kinematics
A Camera Class for OpenGL John McGuiness October 2006.
Advanced Graphics (and Animation) Spring 2002
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Skeletons and Skinning Bones and Skeletons Mesh Skinning Chapter 17 in the textbook.
Advanced Programming for 3D Applications CE Bob Hobbs Staffordshire university Human Motion Lecture 3.
Simulation and Animation
Transforms Hierarchical Modeling Scene Graphs Using hierarchical modeling techniques in 3D software design Transforms Local basis Matrix math review Matrices.
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.
Implementing Scene Graphs, CSG Trees Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, January 26, 2004.
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.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Kinematics Jehee Lee Seoul National University. Kinematics How to animate skeletons (articulated figures) Kinematics is the study of motion without regard.
2008/9/24 Kim, HyungSeok. HyungSeok Kim, Konkuk University Part I: Framework – 1. Windows creation – 2. Renderer – 3. Lights and Objects/Model loading.
Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Combining Transformations We see that we can combine a.
Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Rigging.
CS-378: Game Technology Lecture #13: Animation Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Character Setup In addition to rigging for character models, rigging artists are also responsible for setting up animation controls for anything that is.
1cs426-winter-2008 Notes  Will add references to splines on web page.
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Computer Graphics I, Fall 2008 Hierarchical Modeling II.
Computer Graphics Matrix Hierarchies / Animation
Models & Hierarchies CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
Computer Graphics I, Fall 2008 Hierarchical Modeling I.
Advanced Games Development Physics Engines 2 CO2301 Games Development 1 Week 21.
REFERENCE: QUATERNIONS/ Ogre Transformations.
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
Object Animation CMT3317. Do you need to do animation? We consider ways of animating composite objects – that have a number of different parts e.g. a.
Fundamentals of Computer Animation
Character Animation Forward and Inverse Kinematics
Bones Skeletal Unity-2D How & When
Hierarchical Modeling II
Computer Graphics - Hierarchical Models-
Hierarchical and Object-Oriented Graphics
Skeletons and Skinning
Chapter XIII Character Animation
Computer Animation Algorithms and Techniques
Hierarchical and Object-Oriented Graphics
Computer Graphics Matrix Hierarchies / Animation
Combining Transformations
Presentation transcript:

Advanced Programming for 3D Applications CE Bob Hobbs Staffordshire university Data Structures for Human Motion Lecture 5

2 Example Joint Hierarchy

3 Skeleton Posing Process 1. Specify all DOF values for the skeleton 2. Recursively traverse through the hierarchy starting at the root and use forward kinematics to compute the world matrices 3. Use world matrices to deform skin & render Note: the matrices can also be used for other things such as collision detection, FX, etc.

4 Joint Offsets It is convenient to have a 3D offset vector r for every joint which represents its pivot point relative to its parent’s matrix It is convenient to have a 3D offset vector r for every joint which represents its pivot point relative to its parent’s matrix

5 DOF Limits It is nice to be able to limit a DOF to some range (for example, the elbow could be limited from 0º to 150º) It is nice to be able to limit a DOF to some range (for example, the elbow could be limited from 0º to 150º) Usually, in a realistic character, all DOFs will be limited except the ones controlling the root Usually, in a realistic character, all DOFs will be limited except the ones controlling the root

6 Skeleton Rigging Setting up the skeleton is an important and early part of the rigging process Setting up the skeleton is an important and early part of the rigging process Sometimes, character skeletons are built before the skin, while other times, it is the opposite Sometimes, character skeletons are built before the skin, while other times, it is the opposite To set up a skeleton, an artist uses an interactive tool to: To set up a skeleton, an artist uses an interactive tool to: –Construct the tree –Place joint offsets –Configure joint types –Specify joint limits –Possibly more…

7 Poses Once the skeleton is set up, one can then adjust each of the DOFs to specify the pose of the skeleton Once the skeleton is set up, one can then adjust each of the DOFs to specify the pose of the skeleton We can define a pose Φ more formally as a vector of N numbers that maps to a set of DOFs in the skeleton We can define a pose Φ more formally as a vector of N numbers that maps to a set of DOFs in the skeleton Φ = [φ 1 φ 2 … φ N ] A pose is a convenient unit that can be manipulated by a higher level animation system and then handed down to the skeleton A pose is a convenient unit that can be manipulated by a higher level animation system and then handed down to the skeleton Usually, each joint will have around 1-6 DOFs, but an entire character might have 100+ DOFs in the skeleton Usually, each joint will have around 1-6 DOFs, but an entire character might have 100+ DOFs in the skeleton

8 Hinge Joints (1-DOF Rotational) Rotation around the x-axis: Rotation around the x-axis:

9 Hinge Joints (1-DOF Rotational) Rotation around the y-axis: Rotation around the y-axis:

10 Hinge Joints (1-DOF Rotational) Rotation around the z-axis: Rotation around the z-axis:

11 Hinge Joints (1-DOF Rotational) Rotation around an arbitrary axis a: Rotation around an arbitrary axis a:

12 Universal Joints (2-DOF) For a 2-DOF joint that first rotates around x and then around y: For a 2-DOF joint that first rotates around x and then around y: Different matrices can be formed for different axis combinations Different matrices can be formed for different axis combinations

13 Ball & Socket (3-DOF) For a 3-DOF joint that first rotates around x, y, then z: For a 3-DOF joint that first rotates around x, y, then z: Different matrices can be formed for different axis combinations Different matrices can be formed for different axis combinations

14 Prismatic Joints (1-DOF Translation) 1-DOF translation along an arbitrary axis a: 1-DOF translation along an arbitrary axis a:

15 Translational Joints (3-DOF) For a more general 3-DOF translation: For a more general 3-DOF translation:

16 Software Architecture Object oriented Object oriented Make objects for things that should be objects Make objects for things that should be objects Avoid global data & functions Avoid global data & functions Encapsulate information Encapsulate information Provide useful interfaces Provide useful interfaces Put different objects in different files Put different objects in different files

17 Sample Code Classes Required: Classes Required: –Vector3 –Matrix34 –Tokenizer –Camera –SpinningCube –Tester

18 Sample Skeleton File balljoint root { [data for root] balljoint head { [data for head] [children of head] } balljoint leg_l { [data for leg] [children of leg] } [more children of root] }

19 Skeleton File Data Tokens offsetx y z(joint offset vector) boxminx y z(min corner of box to draw) boxmaxx y z(max corner of box to draw) rotxlimitmin max(x rotation DOF limits) rotylimitmin max(y rotation DOF limits) rotzlimitmin max(z rotation DOF limits) posex y z(values to pose DOFs) balljoint name { }(child joint)

20 Possible Object Breakdown One should consider making objects (classes) for the following: One should consider making objects (classes) for the following: –DOF –Joint –Skeleton

21 Common Routines Many classes will need functions for some or all of the following: Many classes will need functions for some or all of the following: –Constructor / destructor –Initialize –Load –Update (move things, pose, animate…) –Draw –Reset

22 What is a DOF? Data Data –Value –Min, max Functions Functions –SetValue() (can clamp value at the time of setting) –GetValue() –SetMinMax()…

23 What is a Joint? Data Data –Local & World matrices –Array of DOFs –Tree data (child/sibling/parent pointers, etc.) Functions Functions –Update() (recursively generate local matrix & concatenate) –Load() –AddChild() –Draw() Note: One could also make a Joint base class and derive various specific joint types. In this case, it would be a good idea to make a virtual function for MakeLocalMatrix() that the base traversal routine calls Note: One could also make a Joint base class and derive various specific joint types. In this case, it would be a good idea to make a virtual function for MakeLocalMatrix() that the base traversal routine calls

24 What is a Skeleton? Data Data –Joint tree (might only need a pointer to the root joint) Functions Functions –Load –Update (traverses tree & computes joint matrices) –Draw

25 Tree Data Structures The skeleton requires only the most basic N-tree data structure The skeleton requires only the most basic N-tree data structure The main thing the tree needs is an easy way to perform a depth-first traversal The main thing the tree needs is an easy way to perform a depth-first traversal There are several options: There are several options: –Use STL –Implement a tree data structure –Store sibling & first child pointers in the Joint itself –Store a linearized tree as an array in the skeleton

26 Update & Draw void Joint::Update(Matrix &parent) { … // Compute LocalMatrix … // Compute WorldMatrix … // Recursively call Update() on children } void Joint::Draw() {.. // Do some OpenGL.. // Recursively call Draw() on children }

27 Load bool Skeleton::Load(const char *file) { Tokenizer token; token.Open(file,"skel"));token.FindToken("balljoint")); // Parse tree Root=new Joint; Root->Load(token); // Finish token.Close(); return true; }

28 bool Joint::Load(Tokenizer &t) { token.FindToken("{")); while(1) { char temp[256]; token.GetToken(temp); if(strcmp(temp,"offset")==0) { Offset.x=token.GetFloat();Offset.y=token.GetFloat();Offset.z=token.GetFloat();} else // Check for other tokens else if(strcmp(temp,"balljoint")==0) { Joint *jnt=new Joint; jnt->Load(token);AddChild(*jnt);} else if(strcmp(temp,"}")==0) return true; else token.SkipLine();// Unrecognized token }}