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?

Slides:



Advertisements
Similar presentations
1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Advertisements

Computer Graphics 2D & 3D Transformation.
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
University of North Carolina at Greensboro
CMPE 466 COMPUTER GRAPHICS
Viewing and Transformation
6/15/2015©Zachary Wartell 1 OpenGL Transforms with Object-Oriented Framework Revision 1.1 Copyright Zachary Wartell, University of North Carolina at Charlotte,
1 Modeling Transformations  2D Transformations  3D Transformations  OpenGL Transformation.
OpenGL (II). How to Draw a 3-D object on Screen?
2IV60 Computer Graphics 2D transformations
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. 3D Transformation glVertex3f(x, y,z);
Transformations Aaron Bloomfield CS 445: Introduction to 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 고려대학교 컴퓨터 그래픽스 연구실.
2D Transformations.
2003CS Hons RW778 Graphics1 Chapter 5: Transforming Objects 5.2 Introduction to Transformations 5.2 Introduction to Transformations –Affine transformations.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Geometric transformations The Pipeline
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
Day 4 Transformation and 2D
Interactive Computer Graphics CS 418 – Spring 2015 Mesh Rendering, Transformation, Camera Viewing and Projection in OpenGL TA: Zhicheng Yan Sushma S Kini.
Geometry: 2-D Transformations Course web page: Chapter #3.
Stages of Vertex Transformation To specify viewing, modeling, and projection transformations, you construct a 4 × 4 matrix M, which is then multiplied.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Modeling with OpenGL Practice with OpenGL transformations.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
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.
3D Transformations. Translation x’ = x + tx y’ = y + ty z’ = z + tz P = P’ = T = P’ = T. P tx ty tz xyz1xyz1 x’ y’ z’ 1 x y.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
CS552: Computer Graphics Lecture 4: 2D Graphics. Recap 2D Graphics Coordinate systems 2D Transformations o Translation o Scaling o Rotation Combining.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Comp 175C - Computer Graphics Dan Hebert Computer Graphics Comp 175 Chapter 4 Instructor: Dan Hebert.
GL transformations-models. x' = x+t x y' = y+t y z' = z+t z t x t y s x =s y =s z t z uniform nonuniform?!!?? x' = x·s x y' =
CS559: Computer Graphics Lecture 13: Hierarchical Modeling and Curves Li Zhang Spring 2010.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
1 Dr. Scott Schaefer 3D Transformations. 2/149 Review – Vector Operations Dot Product.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
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.
CS380 LAB II OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
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.
Transformations Introduction to Computer Graphics and Animation
Summary of Properties of 3D Affine Transformations
3D Geometric Transformations
Reference1. [OpenGL course slides by Rasmus Stenholt]
Transformation and Viewing
Geometric Transformations
Unit-5 Geometric Objects and Transformations-II
Chapter 4/5 glMatrixMode Modeling Transformations glTranslate glScale
Chapters 5/4 part2 understanding transformations working with matrices
COMP 175: Computer Graphics February 21, 2016
Transformations IV Week 3, Wed Jan 20
Geometric Transformations
Transformations 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Transformations in OpenGL
Geometric Transformations
Geometric Objects and Transformations (II)
Transformations.
Transformations IV Week 3, Wed Jan 23
Geometric Transformations
Presentation transcript:

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? What happens when we translate and scale, or scale then translate (Commutative?) Exercise

Matrices in GL virtual machine OpenGL maintains a matrix stack glPushMatrix() creates pushes a new 4x4 matrix on the top of the stack containing a copy of the existing top of stack matrix. glTranslate, glScale and glRotate cause a new matrix to be contructed and post multiplied by the top of the stack.

The matrix stack glLoadIdentity();M1  I glRotatef();M1  IR1 glTranslatef();M1  IR1T1 glScalef();M1  IR1T1S1 glPushMatrix();M2  M1 glTranslatef();M2  M1T2 glPushMatrix();M3  M2 M1 M2

The view window to viewport transformation In open GL As a set of matrixes

Rotation about z axis

Derive rotation about z Take notes Rotations about x and y.

Exercise: do it by drawing Given a square glRectf(-1,-1,1,1) glRotatef(-30.0,0,0,1); glScalef(2.0,1.0,1.0); gLTranslatef(2.0,0.0,0.0); glRectf (-1,-1,1,1); glTranslatef(0.0,2.0,0.0); glScalef(1.0,2.0,1.0); glRotatef(45,0.0,0.0, 1.0); glRectf (-1,-1,1,1);

The Scene window to viewport mapping Scene window box (Lsw, Rsw, Bsw, Tsw) Viewport box (Lvp, Rvp, Bvp, Tvp); Exercise specify open gl commands to accomplish this) If time construct the matrix (Just the top row)

Some basic linear algebra (CH 4) Dot and Cross Product. A dot product of unit vectors gives the cosine of the angle between two unit vectors a. b = (a 1 *b 1 + a 2 *b 2 + a 3 *b 3 ) = |a||b|cos(  |a| = Sqrt(a 1 *a 1 + a 2 *a 2 + a 3 *a 3 ); a/|a| = a 1 /|a| + a 2/ |a| + a 3 /|a| // unit vector

Cross Product of two vectors a x b = (a 1, a 2, a 3 ) T x (b 1, b 2, b 3 ) The result is a vector = (a 2 * b 3 ) – (a 3 * b 2 ), (a 3 * b 1 ) – (a 1 * b 3 ), (a 1 * b 2 ) – (a 2 * b 1 ) If both vectors are unit vectors the result is at right angles to the plane running through the other two.