1 Scene Graphs ©Anthony Steed 1999-2005. 2 Scene Graph Overview n Building Scene Structures n Traversal n Examples n Instancing and Re-Use n More Transformations.

Slides:



Advertisements
Similar presentations
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Advertisements

1 3D Vector & Matrix Chapter 2. 2 Vector Definition: Vector is a line segment that has the direction. The length of the line segment is called the magnitude.
Computer Graphics Lecture 4 Geometry & Transformations.
Geometric Transformations
Three Dimensional Modeling Transformations
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
3-D Geometry.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
Preorder Traversal with a Stack Push the root onto the stack. While the stack is not empty n pop the stack and visit it.
Direct Kinematics.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Spherical Coordinates
Hierarchical Transformations and Models CSE 3541 Matt Boggus.
Hierarchical Transformations Hierarchical Models Scene Graphs
04 – Geometric Transformations Overview Geometric Primitives –Points, Lines, Planes 2D Geometric Transformations –Translation, Rotation, Scaling, Affine,
Introduction to 3D Graphics Lecture 3: General Camera Model Anthony Steed University College London.
Advanced Graphics (and Animation) Spring 2002
Hierarchy, Modeling, and Scene Graphs Angel: Chapter 10 OpenGL Programming and Reference Guides, other sources. ppt from Angel, AW, etc. CSCI 6360/4360.
C O M P U T E R G R A P H I C S Stuff Jian Chen January 15, 2010 Transformations 1/28 Geometric Transformations By Andries van Dam.
COMP 175: Computer Graphics March 10, 2015
Introduction to 3D Graphics Lecture 4: Scenes and Scene Graphs Anthony Steed University College London.
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
C O M P U T E R G R A P H I C S Stuff CMSC 435 / 634 Transformations 1/29 Geometric Transformations Readings: Chapters 5-6.
And an introduction to matrices COORDINATE SYSTEMS JEFF CHASTINE 1.
Geometric Transforms Changing coordinate systems.
Transforms Hierarchical Modeling Scene Graphs Using hierarchical modeling techniques in 3D software design Transforms Local basis Matrix math review Matrices.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
1 General Camera ©Anthony Steed Overview n Simple camera is limiting and it is necessary to model a camera that can be moved n We will define.
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.
1 Scene Graphs Week 4.2 ©Anthony Steed
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
CS654: Digital Image Analysis Lecture 6: Basic Transformations.
Computer Graphics 3D Transformations. Translation.
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi.
ECE 450 Introduction to Robotics Section: Instructor: Linda A. Gee 10/07/99 Lecture 11.
Computer Graphics Matrix Hierarchies / Animation
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
Lecture 5: Introduction to 3D
Computer Graphics Matrices
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Kinematics Intro :a branch of dynamics that deals with aspects of motion apart from considerations of mass and force Merriam-Webster.
Computer Graphics I, Fall 2008 Hierarchical Modeling I.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
CSCE 441: Computer Graphics: Hierarchical Models Jinxiang Chai.
REFERENCE: QUATERNIONS/ Ogre Transformations.
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Robotic Arms and Matrices By Chris Wong and Chris Marino.
FCC Graficación CAD/CAM 3D Transformations. Contents 1. Translation 2. Scaling 3. Rotation 4. Other Transformations.
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics CC416 Week 15 3D Graphics.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
Hierarchical and Object-Oriented Graphics
Skeletons and Skinning
4-4 Geometric Transformations with Matrices
Chapter XIII Character Animation
2D Geometric Transformations
Hierarchical and Object-Oriented Graphics
PROBLEM SET 6 1. What is the Jacobian for translational velocities of point “P” for the following robot? X0 Y0 Y1 X1, Y2 X2 X3 Y3 P 1 What is the velocity.
Hierarchical Modeling & Constructive Solid Geometry
CSCE441: Computer Graphics Coordinate & Composite Transformations
Geometric Objects and Transformations (II)
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
Presentation transcript:

1 Scene Graphs ©Anthony Steed

2 Scene Graph Overview n Building Scene Structures n Traversal n Examples n Instancing and Re-Use n More Transformations

3 Concept of Scene Graph n Objects placed relative to one another n Objects made of similar components n Directed acyclic graph n Links are transformations n Nodes are empty or contain geometry n The root of the graph corresponds to “world coordinates” Root

4 Use for Animation/Modelling Base Upper Shoulder Elbow Fore Hand

5 Robot as a Graph n Each node other than root contain a piece of geometry n Each link is a transformation matrix, M B, M S, etc. n Main concept is that robot can be posed by changing rotation in Shoulder and Elbow Root Base Shoulder Upper Elbow Fore Hand MBMB MSMS MUMU MEME MFMF MHMH

6 Local Coordinates n Each part of the robot is modelled in its own local coordinate (LC) system n Local coordinates are defined by the person modelling the system n Choice is determined by convenience n Common choices: The centre of the object A corner of the object Base p B1 =(2,0) p B2 =(2,1) Shoulder Hand p H1 =(2,0.5)

7 World Coordinates n Everything is eventually positioned relative to the world coordinates (WC) or room coordinates n We know how to convert WC to viewing coordinates (VC) – it’s the general camera model n Eventually we need to convert points in an object’s LC into WC

8 Local Transform n An object’s local transformation maps LC to the parent’s LC shoulder is translation (0 1 0) from base (M S ) upper arm is translation (0 3 0) from shoulder (M U ) elbow is translation (0 3 0) from upper arm (M E ) fore arm is rotation Z by 90 then translation (0 2 0) (M F ) Etc. n Note that directions such as “up” depend on what transformations have been defined by ancestors in the tree

9 Rendering Traverse n Must get object definitions in WC before passing to camera n For a vertex in the Base object p.M B is in WC n Matrices are inherited down stack n So for object under shoulder p. M S M B is in WC (Note that p. M S is in the local coordinates of the base!)

10 Implementation n Generally implemented by a straightforward recursive descent “push” on graph descend “pop” on graph ascend n The concatenation of all LT matrices above a node is called the current transformation matrix (CTM) Root

11 Sharing Nodes n A common “pattern” found in a scene graph is a multiply instanced geometry n One table many places n Node Table1 has CTM T 1 T 0 n Node Table2 has CTM T 2 T 0 n T 3 =T 4 = I n So TableGeom appears in two different positions TableGeom Table2 Table1 T1T1 T2T2 T0T0 PairTables T3T3 T4T4 Root

12 Spherical Coordinates n Represent a point on a using two angles and . Where r = length(x,y,z) Z P(x,y,z)   X Y Q O Q is projection of P onto XY plane is angle between X axis and OQ  is angle between OP and Z axis

13 Spherical Coordinates n Length OQ = r sin(  ) n So x = r sin(  )cos( ) y = r sin(  )sin( ) z = r cos(  )

14 Rotation About an Arbitrary Axis Z X Y O p1 p2 

15 … 1. Translate p1 so it is at the origin 2. Let p3 = p2-p1 (new position of p2) find spherical co-ordinate of p3 (r, , ) 3. Rotate about Z by - to bring p3 into ZX plane 4. Rotate about Y by -  to bring p3 onto Z axis 5. Now rotate about Z by  6. Invert steps 4-1

16 … Z Y O p1 p2 Z Y O p3 StartTranslate

17 … Z Y p3 Rotate1 Z Y p3 Rotate2 

18 … Z Y p3 After Steps 1-4 n Now we apply the transformation we are after n Invert steps 4-1

19 Scene Graph Recap n Use of scene graph to model environments n Notion of render traversal and the current transformation matrix n Instancing and sharing of nodes n Rotation of objects around an arbitrary axis