Lecture 3: Transforms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Lesson 7.5 Dilations.
Lecture 7 2D Transformation. What is a transformation? Exactly what it says - an operation that transforms or changes a shape (line, shape, drawing etc.)
Computer Graphics 2D & 3D Transformation.
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
CLASS 4 CS770/870. Translation Scale Multiplying Matrices. The R C rule What happens when we do two translates? What happens when we do two scales?
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Lab 1: OpenGL Tutorial CS 282. What’s the plan for today? Go over our framework code. Learn some basic OpenGL! Reveal Lab 1 Answer questions.
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
Objectives Learn to build arbitrary transformation matrices from simple transformations Learn to build arbitrary transformation matrices from simple transformations.
7-2 Similarity and transformations
2IV60 Computer Graphics 2D transformations
Transformations Dilations Translations Reflections Rotations.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
1 Computer Graphics Week7 -2D Rotation. 3-Rotation A shape can be rotated about any of the three axes. A rotation about the z-axis will actually rotate.
SE 313 – Computer Graphics and Visual Programming Lecture 5: Geometric Transformations Lecturer: Gazihan Alankuş Please look at the last slides for assignments.
Lecture 7: Objects and Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
COMP 175: Computer Graphics March 10, 2015
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Transformations of Objects CVG lab. Introduction  Affine transformations : Affine transformations are a fundamental cornerstone of computer graphics.
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Lecture 9: Lighting and Shading 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Lecture 11: Exam Revision 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271  Coursework.
Transformations of Objects – 3D
Games Development 1 Camera Projection / Picking CO3301 Week 8.
Introduction to Computer Graphics 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Reflection Yes No. Reflection Yes No Line Symmetry.
Transformations A rule for moving every point in a figure to a new location.
Lecture 2: Some definitions of terms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Review Inheritance Overloading and overriding. example1.pde.
Problem For the 5 x 3 x -in. angle cross
1/50 CS148: Introduction to Computer Graphics and Imaging Transforms CS148: Introduction to Computer Graphics and Imaging Transforms.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
3-D Geometric Transformations
Computer Graphics Matrices
Composing Transformations
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Chapter 5 Notes. 5.6 Reflections ▪ Reflection (flip) – a transformation in which a figure is reflected over a line of reflection (the x and y axes are.
Computer Graphics Lecture 16 Fasih ur Rehman. Last Class Homogeneous transformations Types of Transformations – Linear Transformations – Affine Transformations.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Transformation Example. Order of Transformation Matters Scale, translate Scale, translate Translate scale Translate scale Rotate, Translate Rotate, Translate.
TRANSFORMATIONS. DEFINITION  A TRANSFORMATION is a change in a figure’s position or size.  An Image is the resulting figure of a translation, rotation,
UNIT 7: TRANSFORMATIONS Final Exam Review. TOPICS TO INCLUDE  Types of Transformations  Translations  Reflections  Rotations  Dilations  Composition.
Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Translation Symmetry (Sliding).
Transforms.
Lesson 3.4 Core Focus on Geometry Dilations.
Glide Reflections and Compositions
Lecture 7 Geometric Transformations (Continued)
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
A movement of a figure in a plane.
Unit 1: Transformations
Transformation in Geometry
Unit 6: Transformations
Transformations Geometry
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Three-Dimensional Graphics
Warm-up Begin at the word “A.” Every time you move, write down the word(s) upon which you land. heart dream a 1. Move to the consecutive interior angle.
Watch out!! OpenGL post-multiplies each new transformation matrix
Maths Unit 12 – Transformations
Transformations with Matrices
Maths Unit 10 (F) – Transformations
Presentation transcript:

Lecture 3: Transforms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 

Lecture 3: Transforms 2 Today’s Lecture and Lab  Review of Tutorial: Circle drawing  This Week Transforms  Today’s tutorial: Transforms in L:\cd2012\transform.cpp

Lecture 3: Transforms 3 Review of Tutorial  Last week we looked at a circle drawing algorithm which you translated from pseudo-code to C/C++  The algorithm calculates the points for one octant. The remaining points are generated by symmetry L:\cd2012\circles.cpp has the working solution  The function circle(int x_centre, int y_centre, int radius) generates the octant points  plot_circle_points() generates the complete circle

Lecture 3: Transforms 4 Transforms  So far everything we have drawn has been relative to the origin, 0,0,0.  This would make complex scenes hard to managed  Most 3D graphics API’s have functions for  Translating (moving) in x, y and z  Scaling, either  making objects smaller or larger  of flipping them over  Rotation about an axis  Transforms in OpenGL are part of the current graphics context - why is this important?

Lecture 3: Transforms 5 Transform functions: Translation  We can use the glTranslated(x,y,z) function to change the current drawing location  For example glTranslated(10.0, 10.0, 0); glRecti(0,0, 15, 10) 10 (x1,y1) (x2,y2)

Lecture 3: Transforms 6 Transform functions: Scaling  Similarly we can change the relative size of the drawn objects with glScaled(x,y,z)  Where the sizes are multiplied in the relevant directions by x, y and z  glScaled(2.0, 2.0, 0); glRecti(0,0, 15, 10) 30 20

Lecture 3: Transforms 7 Transform functions: Rotation  We can also rotate objects about the axes x,y and z with glRotated(angle, x, y, z)  For example  glRotated( 45.0, 0.0, 0.0, 1.0); glRecti(0,0, 30,20) 20 30

Lecture 3: Transforms 8 Transform functions: Combinations  Transforms can be combined but the final effect depends on the order of the transformations A B A: Translated then rotated B: Rotated then translated With B we have flipped the X,Y axes around by 45 degrees

Lecture 3: Transforms 9 Transform functions: Combinations...  Successive transforms are cumulative  Each translation, rotation and scaling will work relative to the last transformation function we used  This is because there is a transform matrix which is part of the current graphics context  The transform matrix is a 4x4 array of values which is used to re-calculate how the current drawing operation will be translated, rotated and/or scaled  We can reset the 4x4 matrix back to the origin values by calling glLoadIdentity()

Lecture 3: Transforms 10 Transform functions: Combinations...  We can use the accumulation of transform operations to draw a set of connected objects in the same location, e.g.  A assembly of parts like a car wheel: tyre, brakes, hub  We can then switch off the accumulated transforms when we wish to move on to drawing another collection of objects  Planning the drawing of a complex object is then a matter of breaking it down into smaller collections  where each smaller part shares a common set of transforms  A common problem is loosing track of which transforms are being applied

Lecture 3: Transforms 11 Transform functions: Combinations...  The file L:\cd2012\transform.cpp has examples of  Drawing a translated rectangle  Drawing a translated and scaled rectangle relative to the first  Resetting the transform matrix  Drawing a rectangle translated and rotated relative to the origin  The tutorial will explore what happens when changes are made to transform.cpp

Lecture 3: Transforms 12