Graphics. Vector and Matrix Algebra. Korea Univ. Computer Graphics Lab. Graphics Korea University.

Similar documents
Graphics. Vector and Matrix Algebra. Korea Univ. Computer Graphics Lab. Graphics Korea University.

BASIC ELEMENTS. Geometry is the study of the relationships among objects in an n-dimensional space

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Geometry. Prof. George Wolberg Dept. of Computer Science City College of New York

Section 1.4: Adding and Subtracting Linear and Perpendicular Vectors

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Vector Calculus: Understanding the Cross Product

x = 12 x = 12 1x = 16

PetShop (BYU Students, SIGGRAPH 2006)

Computing the 3D Viewing Transformation

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Preview. Two-Dimensional Motion and Vectors Section 1. Section 1 Introduction to Vectors. Section 2 Vector Operations. Section 3 Projectile Motion

Game Mathematics. (12 Week Lesson Plan)

Vector Algebra Transformations. Lecture 4

CSE 167: Introduction to Computer Graphics Lecture #2: Coordinate Transformations

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Linear Algebra Review

CS452/552; EE465/505. Geometry Transformations

CS 432 Interactive Computer Graphics

Transformations Computer Graphics I Lecture 4

Transformations Computer Graphics I Lecture 4

Maths for Signals and Systems Linear Algebra in Engineering. Some problems by Gilbert Strang

Computer Graphics. June 23, 2009

Chapter 1: Number and Operations

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

Lecture 9: Transformations. CITS3003 Graphics & Animation

Geometry. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

GPS SP1. Students will analyze the relationships between force, mass, gravity, and the motion of objects.

Principles of Computer Game Design and Implementation. Lecture 6

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

Matrices 4: use of MATLAB

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Computers in Engineering. Linear Algebra Michael A. Hawker

Computers in Engineering COMP 208. Representing Vectors. Vector Operations 11/29/2007. Scaling. Adding and Subtracting

Welcome to Math 275 Topic 1-1: Introduction to Vectors

Eighth Grade Math Assessment Framework Standard 6A Representations and Ordering

Objectives. Geometry. Coordinate-Free Geometry. Basic Elements. Transformations to Change Coordinate Systems. Scalars

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Project 1, 467. (Note: This is not a graphics class. It is ok if your rendering has some flaws, like those gaps in the teapot image above ;-)

Topic 1.6: Lines and Planes

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

Transformations. CSCI 420 Computer Graphics Lecture 4

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

CT5510: Computer Graphics. Transformation BOCHANG MOON

Finite Element Analysis Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology Madras. Module - 01 Lecture - 15

Matrix Multiplication

Attendance (2) Performance (3) Oral (5) Total (10) Dated Sign of Subject Teacher

Important. Compact Trigonometry CSO Prioritized Curriculum. Essential. Page 1 of 6

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten

Answers. Chapter 2. 1) Give the coordinates of the following points:

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

Matrix Multiplication

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

(Creating Arrays & Matrices) Applied Linear Algebra in Geoscience Using MATLAB

Mathematical Operations with Arrays and Matrices

STATISTICS MEAN Know the TOTAL # of points MEDIAN MIDDLE ($) Arrange the scores in order MODE most frequent. RANGE DIFFERENCE in high and low scores

Virtual Environments

Vector Addition. Qty Item Part Number 1 Force Table ME-9447B 1 Mass and Hanger Set ME Carpenter s level 1 String

Transformations. CSCI 420 Computer Graphics Lecture 5

Objectives. Geometry. Basic Elements. Coordinate-Free Geometry. Transformations to Change Coordinate Systems. Scalars

Transformations. OpenGL Transformations. 4x4 Model-view Matrix (this lecture) OpenGL Transformation Matrices. 4x4 Projection Matrix (next lecture)

Geometry. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

SPH3U1 Lesson 05 Kinematics

SOME CONCEPTS IN DISCRETE COSINE TRANSFORMS ~ Jennie G. Abraham Fall 2009, EE5355

Handout 1: Viewing an Animation

Unit Maps: Grade 4 Math

0_PreCNotes17 18.notebook May 16, Chapter 12

Notebook Paper will be essential for notetaking and completing assignments.

Ray Tracing. CS 4620 Lecture 5

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Engineering Methods in Microsoft Excel. Part 1:

Matrices. A Matrix (This one has 2 Rows and 3 Columns) To add two matrices: add the numbers in the matching positions:

Last week. Machiraju/Zhang/Möller

Computer Programming

DIOCESE OF HARRISBURG MATHEMATICS CURRICULUM GRADE 8

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y.

Areas of Planar Regions WORK SHEETS 1

ENGR 1181 MATLAB 4: Array Operations

Mine Shaft Grade 8 Slope Clarification

Therefore, after becoming familiar with the Matrix Method, you will be able to solve a system of two linear equations in four different ways.

Chapter 2 and Supplements MATRICES

Principles of Programming. Chapter 6: Arrays

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

The MatriCs. Reloaded. A linear algebra-specific language for the budding C enthusiast. Short name: MaC Extension:.neo

CS184: Using Quaternions to Represent Rotation

3. Replace any row by the sum of that row and a constant multiple of any other row.

Module 9 : Numerical Relaying II : DSP Perspective

Williamsville C.U.S.D. #15 Mathematics Curriculum

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

What You ll See in This Chapter. Word Cloud. Definitions. Matrix Components. Ian Parberry University of North Texas. Fletcher Dunn

Today s Agenda. Geometry

Fourth Grade Math Assessment Framework Standard 6A - Representations and Ordering. Local Assessment Items. Resources

ENGR 1181 MATLAB 02: Array Creation

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

Transcription:

Graphics Vector and Matrix Algebra Korea Univ. Computer Graphics Lab.

Graphics Vector Algebra

Vector Vector Direction + magnitude

Vector-valued Quantities Force Direction + strength Displacement Direction + distance of moving object Velocities Direction + speed

Vectors for Pure Direction Direction the player is looking in a 3D game Direction a polygon is facing Direction in which a ray of light travels

Drawing Vectors u v (same direction and magnitude) Head u v y Tail x w

Point and Vector Point (x, y, z) A location in 3D space Vector (x, y, z) Direction + magnitude Not fixed at specific location

Left-handed vs. Right-handed Left-handed Coordinate System Direct3D Right-handed Coordinate System OpenGL & Math textbooks [Left-handed] [Right-handed]

Basic Vector Operations Equality Addition/Subtraction Scalar Multiplication

Geometric Interpretations Scalar Multiplication Addition Subtraction

Vector Length/Norm/Magnitude [Pythagorean Formula] T 2 2 2 ( x, y, z) x y z T 2 2 ( x, y) h x y

Unit Vector Unit Vector Having length 1 Normalization Making unit vector u x z, y, u u u u

Dot (Inner/Scalar) Product Dot Product of Two Vectors Result : scalar value Thus, dot product is called scalar product - - + +

Cross (Outer/Vector) Product Cross Product of Two Vectors w is orthogonal to u and v Result : vector Thus, cross product is called vector product

Vector Application : Ray

Vector Application : Line Segment

Vector in Practice class VECTOR { public: float Magnitude(); float InnerProduct(VECTOR v); VECTOR CrossProduct(VECTOR v); float x; float y; float z; }; float VECTOR::Magnitude() { } return sqrt(x*x + y*y + z*z); float VECTOR::InnerProduct(VECTOR v) { } return (x * v.x + y * v.y + z * v.z); VECTOR VECTOR::CrossProduct(VECTOR v) { VECTOR result; result.x = y * v.z - z * v.y; result.y = z * v.x - x * v.z; result.z = x * v.y - y * v.x; } return result;

Graphics Matrix Algebra

Matrix Examples Matrix A : Dimension 4x4 Square matrix Matrix B : Dimension 3x2 Matrix u : Row vector Matrix v : Column vector

Matrix as Vectors Rows of a Matrix as Vectors Columns of a Matrix as Vectors

Basic Matrix Operations Equality Addition/Subtraction Scalar Multiplication

Matrix Multiplications Associativity

Vector-Matrix Multiplication

Various Matrices Transpose of MxN Matrix : NxM Matrix Identity Matrix

Matrix in Practice class MATRIX { public: MATRIX Add(MATRIX m); MATRIX Subtract(MATRIX m); MATRIX Multiply(MATRIX m); MATRIX Transpose(); MATRIX MATRIX::Multiply(MATRIX m) { int i, j, k; MATRIX result; for(i = 0; i < num_of_rows; i++) for(j = 0; j < num_of_columns; j++) result.ele[i][j] = 0.0; }; float float float ele[4][4]; num_of_rows; num_of_columns; MATRIX MATRIX::Add(MATRIX m) { MATRIX result; for(int i = 0; i < num_of_rows; i++) for(int j = 0; j < num_of_columns; j++) result.ele[i][j] = ele[i][j] + m.ele[i][j]; } return result; } } if(num_of_columns == m.num_of_rows) { result.num_of_rows = num_of_rows; result.num_of_columns = m. num_of_columns; for(i = 0; i < num_of_rows; i++) for(j = 0; j < m.num_of_columns; j++) for(k = 0; k < num_of_columns; k++) result.ele[i][j] += ele[i][k] * m.ele[k][j]; return result;