Mathematical Topics Review of some concepts:  trigonometry  aliasing  coordinate systems  homogeneous coordinates  matrices, quaternions.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Computer Graphics Lecture 4 Geometry & Transformations.
UBI 516 Advanced Computer Graphics
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Chapter 4.1 Mathematical Concepts
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3D orientation.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Technical Background.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Mathematical Fundamentals
Rotations and Translations
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Chapter 4.1 Mathematical Concepts
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Section 13.4 The Cross Product. Torque Torque is a measure of how much a force acting on an object causes that object to rotate –The object rotates around.
Computer Graphics Bing-Yu Chen National Taiwan University.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Lecture Notes: Computer Graphics.
Geometric Transforms Changing coordinate systems.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Rotations and Translations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Advanced Computer Graphics Spring 2014
Introduction to Matrices and Vectors Sebastian van Delden USC Upstate
Geometric Objects and Transformation
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Affine Geometry.
Computer Graphics Matrices
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
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.
Computer Graphics I, Fall 2010 Transformations.
Chapter 3 Lecture 5: Vectors HW1 (problems): 1.18, 1.27, 2.11, 2.17, 2.21, 2.35, 2.51, 2.67 Due Thursday, Feb. 11.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Image Warping 2D Geometric Transformations
CA 302 Computer Graphics and Visual Programming
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Computer Animation Algorithms and Techniques
CPSC 641: Computer Graphics Rotation Representation and Interpolation
Review: Transformations
Mobile Robot Kinematics
COMP 175: Computer Graphics February 9, 2016
(c) University of Wisconsin, CS559
UMBC Graphics for Games
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
Presentation transcript:

Mathematical Topics Review of some concepts:  trigonometry  aliasing  coordinate systems  homogeneous coordinates  matrices, quaternions

Vectors v = ai + bj + ck Describes point or displacement in n-dimensional space Addition, subtraction Multiplication  scalar times vector  dot product  cross product (only in 3D)

Polar Coordinates θ r x = r cos θ y = r sin θ

Trigonometry sin and cos, arcsin, arccos, tan, arctan Relationships between angles and lengths of sides of triangles "Old Hands Always Help One Another"  mnemonic for right triangles Axes form right triangle x = r cos θ y = r sin θ θ r

Cylindrical Coordinates 3D generalization of polar coordinates r θ θ r z x = r cos θ y = r sin θ z = z

Spherical Coordinates r θ φ θ r x = r cos θ sin φ y = r sin θ sin φ z = r cos φ θ in (0,2π) φ in (0,π)

Homogeneous Coordinates In Cartesian coordinates, a point is (x, y, z) In homogeneous coordinates, (x, y, z, 1)  generally, (x, y, z, w) Homogenization: (x/w, y/w, z/w, 1)  The following points are equivalent:  (1,2,3,1)  (2,4,6,2)  (10,20,30,10) Used for translation, revisit when we do perspective

Matrices 2d array of scalars Can be thought of as "vector of vectors" Encodes a set of linear equations  "linear" because each variable has power 1 max Main operation: multiplication Addition possible (rarely used in graphics)  A + B given by entrywise addition of A[i][j]+B[i][j]

Matrix Multiplication multiply a matrix and a scalar:  s*A given by entrywise multiplication of s*A[i][j] multiply a vector and a matrix  result is a vector of appropriate length multiply two matrices  result is a matrix of appropriate dimensions

Matrix Operation Properties A(BC) = (AB)C  Multiplication is associative AB != BA (in general)  Multiplication is not commutative Implications for coordinate transforms:  We can gather transforms into a single matrix  We must do elementary transforms in the proper order – translate then scale != scale then translate

Matrix Rotations We saw how matrices can encode rotations Euler: any orientation described by axis of rotation and magnitude of rotation from canonical orientation  only need 3 values (2 for unit axis) Rotation matrix: 9 elements, redundant Problem: composing lots of rotations leads to transformations that are not rotations  numerical errors inevitable  skew, distort the model

Quaternions Mathematical entity made up of a scalar and a vector q = s+ u, q' = c' + u' q = s + (xi + yj + zk) q + q': entrywise addition q * q' = s*s' - u∙u' + (u x u' + s*u' + s' * u) Multiplicative identity: 1 + (0,0,0)

Imaginary Numbers Recall complex numbers, a+bi, i = sqrt(-1) Have geometric interpretation: points in 2D Quaternions: generalized complex numbers Im Re

4D Complex Numbers i 2 = j 2 = k 2 = -1 ij = k ji = -k a + bi + cj + dk 4D imaginary number, or (s, v) with vector interpretation of i, j, k  arithmetical properties of quaternions follow from the complex interpretation

Quaternions for Rotation A rotation is really just an axis and an angle Quaternion as rotation  q = (s,v)  vector (axis of rotation)  scalar (amount of rotation) Can convert quaternion to rotation matrix, or apply to vector directly (XNA supports both)

Quaternion Rotations Written as (cos(θ/2), v sin(θ/2)) "Unit quaternion": q∙q = 1 (if v is a unit vector) Maintain unit quaternion by normalizing v Why not use s for angle, v for axis directly?  lack ability to normalize (trivial objection)  difficult to compose rotations (serious) “In mathematics you don't understand things. You just get used to them.” (von Neumann)

Composing Rotations With two rotations, say q1 and q2, we can create a composite rotation q3 = q1*q2 XNA: Quaternion.Multiply(q1, q2); Note: quaternion multiplication not commutative, just as rotations are not commutative (order matters)

Inverting Rotations If you do a rotation of s about axis v...  quaternion (s,v)...you can reverse it by rotating by –s about v  quaternion (-s,v) – but AVOID preferred method is to rotate by s about –v  superior theoretical properties  same meaning strange fact: (s, v) = (-s, -v) geometrically

Quaternion Rotation Arbitrary vector r can be written in quaternion form as (0, r) To rotate a vector r by θ about axis v:  take q = (cos(θ/2), v sin(θ/2) )  Let p = (0,r)  obtain p' from the quaternion resulting from qpq -1  p' = (0, r')  r' is the rotated vector r

Quaternion Properties Advantages:  reasonably compact  normalization enforces legitimate rotations  interpolation of orientation well-defined  useful for animation, will not use much in this course Disadvantages  no significant technical disadvantages  requires 4 coordinates, possible to use 3  difficult to understand, develop intuition for

Aliasing General term nowadays, like "bug":  visual defect in computer graphics program Properly, narrow definition: mismatch between sampling rate and underlying signal Underlying signal: image, texture, synthetic structure Sampling rate: one sample per pixel (?)

["Reflection", Nathan Sawaya]

Reconstructed signal will not match real signal

Moire pattern

Sampling Limit Need two samples per period of signal If signal has maximum frequency < B, spatial sampling rate 1/(2B) sufficient In practice, output sampling (display) fixed Need to control signal “Don’t wear stripes on television”

Antialiasing Pixel resolution fixed But, can use more than one sample per pixel Antialiasing strategy: compute multiple samples, average them Recent improvements: try not to average across an edge

Antialiasing Nvidia 2003