Download presentation
Presentation is loading. Please wait.
Published bySibyl Lawson Modified over 9 years ago
1
Hierarchical Transformations and Models CSE 3541 Matt Boggus
2
Overview Previously – Modeling Transformations – Translate, Rotate, Scale (Fortress Quest)Fortress Quest Parenting in Unity Scene Modeling – instances Hierarchical modeling – Place model pieces relative to other model pieces – Place objects relative to other objects – Tree representation and traversal Examples – Robot arm – Humanoid robot – Scene graphs
3
Unity parenting and lab2 demo ParentingExample Unity Package
4
Modeling Objects A model has a default size, position, and orientation Modeling transformations set its appearance within the scene Create a unit cylinder with its origin at (0,0,0)
5
Instance Transformation Start with an object – a symbol Each appearance of the object in the scene is an instance – Has its own scale, rotate, and translate
6
Symbol-Instance Table Store a model by assigning a number to each symbol and storing the parameters for the instance transformation
7
Scene example
8
Critical Thinking – Symbol-Instance Table What does not have the be recomputed when using a symbol-instance table? A.Vertex positions in local/model space B.Transformation matrices C.Both D.Neither
9
Symbol-Instance table efficiency 1 scale, 1 rotate, and 1 translate for each house Symbol-instance tables reuse data, but not the result of transformations
10
Draw a robot Images by Denis Zorin
11
Draw a robot Images by Denis Zorin
12
Draw a robot Positioning individual parts is hard If the whole robot moves – Reposition everything If only the upper arm moves – Reposition the upper and lower arm Divide the robot into pieces! – Combine as a hierarchy
13
Graphs Set of nodes and edges (links) Edge connects a pair of nodes – Directed or undirected Cycle: directed path that is a loop loop
14
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 leaf node
15
Robot as a hierarchy a.k.a. tree or directed acyclic graph Images by Denis Zorin
16
Modeling with Trees/Graphs Nodes – What to draw – Pointers to children Edges – May have information on incremental changes to transformation matrices (can also store in nodes)
17
Robot Arm robot arm parts in their own coordinate systems
18
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
19
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
20
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
21
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 lower 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
22
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
23
A Chain of Transformations
24
Thinking of Transformations In a view of body-attached coordinate system
25
Thinking of Transformations In a view of body-attached coordinate system
26
Thinking of Transformations In a view of body-attached coordinate system
27
Thinking of Transformations In a view of body-attached coordinate system
28
Thinking of Transformations In a view of body-attached coordinate system
29
Thinking of Transformations In a view of global coordinate system
30
Thinking of Transformations In a view of global coordinate system
31
Thinking of Transformations In a view of global coordinate system
32
Thinking of Transformations In a view of global coordinate system
33
Thinking of Transformations In a view of global coordinate system
34
Robot as a hierarchy (save intermediate transformations) Images by Denis Zorin
35
Scene Graphs Encoding the information in software lacks reusability Want a flexible, data-driven and extensible approach Scene-graphs – OpenInventor (http://www.coin3d.org/)http://www.coin3d.org/ – Open Scene Graph (http://www.openscenegraph.com/)http://www.openscenegraph.com/ – Many others
36
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
37
Sample Scene
38
Hierarchical scene – chair 1
39
Hierarchical scene – chair 2
40
Hierarchical scene - chessboard
41
White chess pieces – child of chessboard
42
Rook piece – child of white chess pieces
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.