Lecture_Chapter4_b

Lecture_Chapter4_b - Review of Thursday Vectors and points...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Review of Thursday Vectors and points are two/three-dimensional objects Operations on vectors (dot product, cross product, ) Matrices are linear transformations of vectors Objects are transformed by applying transformation matrix to its vertices (coordinate transformation) 29 ECS 175 Chapter 4: Object Transformation ab cd ± · ° x y ± = ° xa + yb xc + yd ±
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Review of Thursday Objects are transformed by applying transformation matrix to its vertices (coordinate transformation) 30 ECS 175 Chapter 4: Object Transformation anisotropic scaling 20 03 ± · ° 1 1 ± = ° 2 3 ± ± · ° 3 3 ± = ° 6 9 ± ± · ° 4 1 ± = ° 8 3 ± det ( M )=6
Background image of page 2
A Brief Review of Linear Algebra Rotation 31 ECS 175 Chapter 4: Object Transformation counterclockwise (positive direction of rotation) Determinant: cos α · cos α sin α · ( sin α )=1 cos α sin α sin α cos α ± Inverse M 1 = M T
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
A Brief Review of Linear Algebra Constructing a rotation matrix 32 ECS 175 Chapter 4: Object Transformation cos α sin α sin α cos α ± M (1 , 0) T = (cos α, sin α ) T M (0 , 1) T =( sin α, cos α ) T ( a, b ) T = a (1 , 0) T + b (0 , 1) T M ( a, b ) T = aM (1 , 0) T + bM (0 , 1) T M ( a, b ) T a cos α b sin α,a sin α + b cos α ) T columns correspond to axes of new coordinate frame (linearity of M)
Background image of page 4
A Brief Review of Linear Algebra Shear transformation (shearing) Reflection 33 ECS 175 Chapter 4: Object Transformation 10 0 . 51 ± displacement along direction proportional to (signed) distance to a line 01 ±
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
A Brief Review of Linear Algebra Applying multiple transformations in sequence 34 ECS 175 Chapter 4: Object Transformation M scal · M rot · v = v ° ( M scal · M ) · v = v ° Order of operations is important!
Background image of page 6
Notes on Matrices in OpenGL 35 ECS 175 Chapter 4: Object Transformation OpenGL <3.0 includes matrix operations and stack Matrix operations and stack deprecated in OpenGL 3.0+ Implement own transformation matrices Pass to vertex shader (OpenGL/GLSL: uniform variables) glMatrixMode( ) glLoadMatrix( ) glMultMatrix( ) glPushMatrix() //push current matrix to top of stack glPopMatrix() //take matrix from top of stack Assignment 2: You may use glLoadMatrix, glMultMatrix or pass the matrices to the vertex shader as uniform variables (do not use glTranslate, glRotate).
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Notes on Matrices in OpenGL 36 ECS 175 Chapter 4: Object Transformation OpenGL <3.0 vertex shader example OpenGL 3.0+ vertex shader example void main(void) {
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 28

Lecture_Chapter4_b - Review of Thursday Vectors and points...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online