CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9
Hierarchical and Object- Oriented Modeling Problem is how to organize related elements of an object to be rendered Hierarchical representation –Tree with subtrees representing components –Object-Oriented Model
Problems with Linear Models How to represent dependencies –Wheels of a car move with the car –Position of hand depends on position of arm which depends on position of body, etc.
Tree Structure Shows dependencies but introduces redunancy –All wheels of a car are the same but drawn in different positions or from different views Can generalize to directed acyclic graph, DAG Example: Robot Arm
Traversal Can traverse as tree or DAG Position of components depending on position of other components functions in stack fashion Can save transform matrix, alter sub components, and then restore matrix when returning to base component Can add special nodes to save/restore transform matrix
Animation Kinematics –Describe position of parts based on joint angles Dynamics –Describe changes in terms of forces applied –Physics engine may be used
Animation.2 Consider following problem –Start figure in one position –Determine final position How can we change articulation angles to transform between the two? –Inverse kinematics / dynamics –Generally no simple function
Animation.3 Approximate solutions –Key frame animation design key frames interpolate angles to transform between, tweening –Morphing Interpolate shapes
Object-Oriented Approach Define classes for components –Most easily built on class version of OpenGL Example classes in text, pp GLT, OpenGL C++ Toolkit GLT