Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hierarchical Modeling

Similar presentations


Presentation on theme: "Hierarchical Modeling"— Presentation transcript:

1 Hierarchical Modeling
Model: Representation of a system Modeling: Creation and manipulation of a system representation Geometric Model: Graphical representation of a system using geometric shapes Symbol: Representation of system component Instance: Each occurrence of a symbol within a model

2 Hierarchical Tree Structure
robot base body torso head left arm right arm base(1) head(1) torso(1) arm(2) basic symbols (number of instances) lb lh la lt wb wh wa wt

3 Ingredients of a geometric model:
Geometric shapes and other attributes of components Interconnection between components Other properties of components (physical properties, text description, etc.) Interconnections shoulders 1 2 neck waist base and body torso and head torso and arms

4 Local Coordinates and World Coordinates
World Coordinates (Global Coordinates): A global reference frame that contains all the models. Local Coordinates (Modeling Coordinates, Master Coordinates): Coordinate system that is attached to an individual component. y World coordinate system x

5 Local coordinate systems
x x x robot base body y y y x x x torso head arm

6 Modeling Transformation
Modeling Transformation: Transform model components from local coordinate system to world coordinate system. Two different views of modeling transformation: Global View: Transform object in world coordinate system Local View: Transform local coordinate system of an object

7 Global View: Rz(45) T(10, 0, 0) Local View: T(10, 0, 0) Rz(45)

8 Global View: T(10, 0, 0) Rz(45) Local View: Rz(45) T(10, 0, 0)

9 The following two views are equivalent for composite transformation:
M = Mn  Mn-1  ... M2  M1 Global View: Transform the object with M1. Transform the object with M2. . . . Transform the object with Mn. Draw the object in world coordinate system. Local View: Transform the local coordinate system with Mn. Transform the local coordinate system with Mn-1. . . . Transform the local coordinate system with M1. Draw the object in local coordinate system. Transformation of local coordinate system is relative to itself

10 In hierarchical tree structure, each tree node stores transformation matrix from its parent’s local coordinate system to its own local coordinate system. y x

11 waist neck

12 left shoulder 1 right shoulder 2

13 Hierarchical Tree Traversal
Tree_traverse( NODE n, MATRIX M ) { M1 = local transformation matrix of n; M = M  M1; if (n is a leaf) Set current transformation matrix to M; Draw object associated with leaf n; } else for (each child node n1 of n) Tree_traverse( n1, M ); NODE: Data structure for hierarchical tree node MATRIX: Data structure for 4 by 4 transformation matrix

14 Example for the robot: Draw_robot( MATRIX M ) { Draw_base( M );
Draw_body( M ); } Draw_base( MATRIX M ) { M = M  Mbase; Set current transformation matrix to M; Draw geometric structure for base; } Draw_body( MATRIX M ) { M = M  Mbody; Draw_torso( M ); Draw_head( M ); Draw_arm( M  Mleftarm ); Draw_arm( M  Mrightarm ); }

15 Draw_torso( MATRIX M ) { M = M  Mtorso; Set current transformation matrix to M; Draw geometric structure for torso; } Draw_head( MATRIX M ) { M = M  Mhead; Set current transformation matrix to M; Draw geometric structure for head; } Draw_arm( MATRIX M ) { Set current transformation matrix to M; Draw geometric structure for arm; }

16 Physics Based Modeling
Particle Systems Collection of particles moving under external forces. Can be used to model clouds, smoke, fire, fireworks, explosion, waterfalls, fountain, etc. Particle Properties: position velocity mass age life span shape, color, texture, etc. Particle System Particle generation and annihilation External force field construction Particle movement control Particle rendering

17 Particle generation and annihilation
Controlled randomization on initial properties of particles Fireworks Fountain Waterfall while (…) { Get elapsed time dt; n = generation rate * dt; Generate n new particles; for (each particle) Update particle velocity and position; age += dt; if (age > life span) delete particle; }

18 External force field construction
Gravity Buoyant force Air friction Sine wave Add randomization to the force field Particle movement control Newtonian law Numerical time integration

19 Particle rendering Render particle as a texture mapped quad The quad should always face the viewer (billboard effect) C U D P B R F A F: Camera Forward Direction U: Camera Up Direction R: Camera Right Direction P: Particle Position a: Particle Size

20 Cloth simulation using Mass-Spring model
A number of particles with mass interconnected by springs (i, j+2) (i+1, j+1) (i, j+1) (i, j) (i+1, j) (i+2, j)

21 Types of springs Tensile spring Shear spring Bending spring (i, j+1)

22 Spring forces vj vi xj xi mass particle original position position velocity i x0i xi vi j x0j xj vj Elastic force Damping force

23 Dynamic equations for mass particles
Numerical time integration Collision detection and collision response

24 Examples

25 Skeletal Animation Hierarchical Bone Structure Joint tree neck
right shoulder left shoulder hip right thigh left thigh chest right elbow left elbow waist right knee Left knee waist right wrist left wrist right ankle left ankle hip chest right thigh left thigh right shoulder left shoulder neck right knee Left knee right elbow left elbow right ankle left ankle right wrist left wrist

26 Joint Transformations
For joint i: Tilocal: Position relative to its parent joint Rilocal: Rotation transformation relative to its parent joint Tiworld: Position in world coordinate system Riworld: Rotation transformation in world coordinate system Assume joint i’s parent is joint j, then:

27 Vertex Skinning Each vertex is attached to one or more joints
For vertex i: wij: Weight for joint j Pijlocal: Position in joint j’s local coordinate system Piworld: Position in world coordinate system

28 Key Frame Animation ...... Key frames Frame 0 Frame 1 Frame 2 ...... t
Frame interval: t Frame rate: 1/t

29 Key Frame Interpolation
Intermediate Frame Frame k Frame k+1 t h t Position interpolation

30 Slerp (Spherical Linear Interpolation) for rotation
Slerp in 2D P A B

31 Quaternion Slerp When cos > 0 When cos < 0


Download ppt "Hierarchical Modeling"

Similar presentations


Ads by Google