Rotation about Arbitrary Axis oOften we need rotation about a vector U that is not a coordinate axis (not X, nor Y, nor Z) and may not pass through the.

Slides:



Advertisements
Similar presentations
Computer Graphics 2D & 3D Transformation.
Advertisements

Robot Modeling and the Forward Kinematic Solution
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Computer Graphics Lecture 4 Geometry & Transformations.
Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Forward and Inverse Kinematics CSE 3541 Matt Boggus.
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
CMPE 466 COMPUTER GRAPHICS
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
Animation. Outline  Key frame animation  Hierarchical animation  Inverse kinematics.
2IV60 Computer Graphics 2D transformations
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
Hierarchical Transformations Hierarchical Models Scene Graphs
Lecture Fall 2001 Computer Animation Fundamentals Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics.
Advanced Graphics (and Animation) Spring 2002
COMP 175: Computer Graphics March 10, 2015
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Geometric Transforms Changing coordinate systems.
Geometric Transformations Jehee Lee Seoul National University.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
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 CSCE441: Computer Graphics 3D Transformations 0.
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.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Transformations Tutorial
1/50 CS148: Introduction to Computer Graphics and Imaging Transforms CS148: Introduction to Computer Graphics and Imaging Transforms.
2 COEN Computer Graphics I Evening’s Goals n Discuss viewing and modeling transformations n Describe matrix stacks and their uses n Show basic geometric.
CSCI480/582 Lecture 8 Chap.2.1 Principles of Key-framing Techniques Feb, 9, 2009.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
Transformation. 3D Transformation oIn the modeling lecture we saw how to define an object in terms of its vertices in object space oWe will now see how.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Forward Kinematics Where is my hand ?. Examples Denavit-Hartenberg Specialized description of articulated figures (joints) Each joint has only one degree.
CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai.
The Modelview Stack Lecture 9 Wed, Sep 12, The Modelview Stack OpenGL maintains a stack of matrices. The matrix on top of the stack is the current.
Robotics Chapter 3 – Forward Kinematics
Character Animation Forward and Inverse Kinematics
Computer Graphics CC416 Week 15 3D Graphics.
Direct Manipulator Kinematics
Lecture 2 Transformations
CHAPTER 2 FORWARD KINEMATIC 1.
Computer Graphics - Hierarchical Models-
Mobile Robot Kinematics
Hierarchical and Object-Oriented Graphics
CSCE 441: Computer Graphics: Hierarchical Models
Chapters 5/4 part2 understanding transformations working with matrices
Computer Animation Algorithms and Techniques
Hierarchical and Object-Oriented Graphics
Transformations 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Prepared by: Engr . Syed Atir Iftikhar
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
UMBC Graphics for Games
Geometric Objects and Transformations (II)
Transformations III Week 3, Mon Jan 21
CSCE441: Computer Graphics 2D/3D Transformations
Viewing/Projections I Week 3, Fri Jan 25
Computer Graphics Lecture 15.
ATEC Procedural Animation
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
Hierarchical Modeling
Computer Graphics Matrix Hierarchies / Animation
CSCE 441: Computer Graphics: Hierarchical Models
Presentation transcript:

Rotation about Arbitrary Axis oOften we need rotation about a vector U that is not a coordinate axis (not X, nor Y, nor Z) and may not pass through the coordinate origin oIn this situation we will align U with either X, or Y, or Z, then rotate about this coordinate axis - any transformation to align U will be applied to all objects in the scene oThe translation or the rotations done to align U with the coordinate axis need to be reversed to move U back to its initial position - any transformation to move U back will be applied to all objects in the scene

Rotation about an Arbitrary Axis oFirst, translate the vector to coordinate origin: oA rotation about X to bring it to XoZ plane; oA clockwise rotation about Y to align it with Z axis; oNow a rotation about Z is equivalent to rotation about U; oUndo rotations about Y and X.

Exercise oA pyramid is defined by five vertices A, B, C, D, and E. The pyramid has to be rotated by 45 degrees about a vector V=(-1,1,0), originating from the point B which is one unit along the positive z-axis. Derive the composite transformation matrix that performs this rotation. Yy X Z V = (-1, 1, 0) C D A B E

Today’s Lecture oHierarchical modelling oCreating more complex object/scene oSimple animation oOpenGL transformation matrix stacks oStore transformation matrices being used oPush/pop transformation matrix stack oSave scene state for coming back to later oL-Systems oPixar lamp demo

Hierarchical Modeling Scene RobotBall ArmWheelsArm UpperArm LowerArm Hand Finger Wheel

Hierarchical Modelling Root node An arc Human body is hierarchical, with body, head, upper arm, lower arm, etc…

Data Structure for Hierarchical Modelling oGenerally represented as a tree, with nodes and arcs oA node is a link or a part of the object oAn arc contains transformation to be applied to the node, and the rest of the linkage further down the hierarchy oIt is convenient to define points in the local coordinate system associated with a joint and to have a method for converting the coordinates of a point from one system to another

Data Structure for Hierarchical Modelling T0T0    Data for link 0 Data for link 1 Data for link 1.1 T0T0 T 1 transform link1 relative to link0 T 1.1transform link1.1 relative to link1 R1(R1( R 1.1 (    link 0 link 1 link 1.1

Kinematics oThe study of object movements irrespective of their speed or style of movement oForward Kinematics oCompute configuration (pose) given individual DoF values oInverse Kinematics oCompute individual DoF values that result in specified end effector position

Data Structure for Hierarchical Modelling oSkeletal systems are hierarchical in nature and allow control of the character in an efficient manner oA skeleton consists of rigid links and joints, which can be represented as a tree, and it allows the use of inverse kinematics to animate a character

Skeleton Animation oWe create a coordinate frame for the 3D hand, as well as a local frames for skeletons. In a local frame, one axis is the normal of the cross-section plane of the hand surface. The other two axes span the cross-section plane oEach point on the 3D hand model corresponds to a cross-section plane, and therefore a point on a skeleton oWhen the skeleton moves, the local frames on the skeleton are updated and the vertices on the hand model are updated accordingly oMotion capture is the recording of human body movement and mapping it onto the motion of a computer character

Animation Techniques oKey framing - the artists draw the major frames of the animation. Major frames are the ones in which prominent changes take place. The animator specifies critical or key positions for the objects. The computer then automatically fills in the missing frames by smoothly interpolating between those positions. oProcedural - the objects are animated by a procedure /a set of rules. The animator specifies rules and initial conditions. oPhysically Based - this uses the laws of physics to generate object motions. oPerformance Based (motion capture) - sensors record the actions of a human or animal object. A computer then uses these data to animate the object. This is popular with the animators mainly because human actions can be captured easily.

Interpolation-based animation: Keyframe Animation oThe keyframe of a model contains information such as the model's structure, position, orientation, and scale, e.g., 3 key frames:

Interpolation based Keyframe Animation oSuppose we have two keyframes that contain a bone structure with three joints (red, green and blue vertices) oWe render frame one, then an intermediate scene (obtained through interpolation) before rendering frame two for a more smooth animation flow e.g., linear interpolation: p = (1-  p1 +  p2  1-  p1p2p

OpenGL Matrix Stacks oThere are 3 transformation matrix stacks: oModel-View - glMatrixMode(GL_MODELVIEW); oProjection - glMatrixMode(GL_PROJECTION); oTexture - glMatrixMode(GL_TEXTURE); oWhen Model-View mode starts, usually an identity matrix is created, which becomes the ‘current matrix’ and sits on top of the matrix stack oWhen other transformations are called later in the program, the current matrix is updated, e.g., multiplied by new matrices corresponding to the transformations called

OpenGL Matrix Stacks oSay you call glMatrixMode(GL_MODELVIEW), and glLoadIdentity(), OpenGL creates an identity matrix (1s on diagonal line 0s on others) oIf you then call glTranslatef(0,0,-250), the current matrix will be oIf you call glTranslatef(0,0,-250) again, current matrix will be: oIf you then call DrawCube() – the cube will be drawn at a distance of 500 from the origin, in the -Z direction

Push/Pop Matrix Stacks oIf at some point you need to turn back the clock, e.g., going back to a previous position of your object/scene, you should call glPushMatrix(), which will save a copy of the current matrix and put it on top of the stack oWhen you are ready to go back to the previous position, you should use glPopMatrix(), which will ‘pop’ the saved matrix off the stack, and you are back where you were

Push/Pop Matrix Stacks oThe modelling stack in action: oglPushMatrix(); oglTranslatef(0,10,0); oglPushMatrix(); oglTranslatef(10,0,0); oglRotatef(45,0,1,0); oglPushMatrix(); oglRotatef(45,0,1,0); oglPopMatrix(); I * T I * T * T I * T I * T * T * R I * T I * T * T * R I * T I * T * T * R I * T * T * R * R

Drawing a Hand using glPushMatrix()/ glPopMatrix() oSay you are at the centre of the palm (CoP) oglPushMatrix() to save a copy of current matrix oRotate and translate to draw thumb as a cylinder oglPopMatrix() so you are at the CoP again oglPushMatrix() to save a copy of current matrix oRotate and translate to draw index finger oglPopMatrix() so you are at the CoP again, ready to draw middle finger, and so on

L-Systems oRewriting is a technique for defining complex objects by successively replacing parts of an initial object using a set of rewriting rules oEssentially, generate a string that describes the object, replacing sub-strings with some new strings A rewriting system – the L-systems: oProduction rules below are applied ob → a. oa → ab. owhich means a is replaced by ab, b is replaced by a. initially we have word ab, now we have word aba oSimilarly, aba yields abaab which in turn yields abaababa, then abaababaabaab, and so on

L-Systems F : Move forward a step of length d. + : Turn left by angle δ. − : Turn right by angle δ a : F − F − F − F b : F → F − F + F + FF − F − F + F

L-Systems Prusinkiewicz, Hammel, Mech

Next Lab oHave fun with the Pixar lamp programs! oIntegrate them with the Framework provided, e.g., oadd Pixar lamp class/header to MyCode, ocreate a Pixar lamp object and add it to myScene oexperiment with different statements to change the lamp’s structure or appearance to understand the statements better oget help in the lab if you have an problem