Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Similar documents
Geometric Transformations

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

2D/3D Geometric Transformations and Scene Graphs

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

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Last week. Machiraju/Zhang/Möller/Fuhrmann

Transforms 1 Christian Miller CS Fall 2011

2D transformations: An introduction to the maths behind computer graphics

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Camera Model and Calibration

CS354 Computer Graphics Rotations and Quaternions

UNIT 2 2D TRANSFORMATIONS

METR 4202: Advanced Control & Robotics

Why animate humans? Why is this hard? Aspects of the Problem. These lectures. Animation Apreciation 101

Overview. By end of the week:

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Drawing in 3D (viewing, projection, and the rest of the pipeline)

2D Object Definition (1/3)

Vector Algebra Transformations. Lecture 4

3D Rotations and Complex Representations. Computer Graphics CMU /15-662, Fall 2017

Kinematics and Orientations

Linear and Affine Transformations Coordinate Systems

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Transforms. COMP 575/770 Spring 2013

Ray Polygon Intersection.

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1

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

Advanced Computer Graphics Transformations. Matthias Teschner

Game Engineering: 2D

Perspective projection and Transformations

1 Affine and Projective Coordinate Notation

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

Modeling Transformations

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016

2D and 3D Transformations AUI Course Denbigh Starkey

Transformations Week 9, Lecture 18

CS6670: Computer Vision

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

CMSC427 Final Practice v2 Fall 2017

3-D D Euclidean Space - Vectors

3D Viewing. CS 4620 Lecture 8

Vision Review: Image Formation. Course web page:

COMP3421. Vector geometry, Clipping

CS6670: Computer Vision

CS-321 Thursday 12 September 2002 Quiz (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)?

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Computer Graphics: Geometric Transformations

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

Camera Model and Calibration. Lecture-12

Early Fundamentals of Coordinate Changes and Rotation Matrices for 3D Computer Vision

Graphics pipeline and transformations. Composition of transformations

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Translations. Geometric Image Transformations. Two-Dimensional Geometric Transforms. Groups and Composition

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Agenda. Rotations. Camera models. Camera calibration. Homographies

Affine Transformations in 3D

Specifying Complex Scenes

CS 4620 Midterm 1. Tuesday 22 October minutes

Visual Recognition: Image Formation

6.837 LECTURE 7. Lecture 7 Outline Fall '01. Lecture Fall '01

Rigging / Skinning. based on Taku Komura, Jehee Lee and Charles B.Own's slides

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

CS251 Spring 2014 Lecture 7

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

GEOMETRIC TRANSFORMATIONS AND VIEWING

CSE328 Fundamentals of Computer Graphics

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

Computer Graphics Hands-on

CS 559 Computer Graphics Midterm Exam March 22, :30-3:45 pm

You will have the entire period (until 9:00pm) to complete the exam, although the exam is designed to take less time.

CS559: Computer Graphics

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

Game Engineering CS S-05 Linear Transforms

Shadows in Computer Graphics

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Camera Calibration. COS 429 Princeton University

Transformation Algebra

Lecture 7: Computational Geometry

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Graphics and Interaction Transformation geometry and homogeneous coordinates

Institutionen för systemteknik

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

CS612 - Algorithms in Bioinformatics

CS3621 Midterm Solution (Fall 2005) 150 points

Computer Graphics Hands-on

CV: 3D sensing and calibration

Autonomous Navigation for Flying Robots

CT5510: Computer Graphics. Transformation BOCHANG MOON

Lecture 5 2D Transformation

N-Views (1) Homographies and Projection

Computer Graphics Geometric Transformations

Transcription:

CS559 Lecture Polygons, Transformations These are course notes (not used as slides) Written by Mike Gleicher, Oct. 005 With some slides adapted from the notes of Stephen Chenney Final version (after class) Today Polygon rules (since I got them wrong last time) Homogeneous coordinates Working with transformations / composition Hierarchies / Matrix Stacks 005 Michael L. Gleicher Transformations in D Coordinate systems in D Rotations Projections (D->D) General Polygons? Inside / Outside not obvious for general polygons Usually require simple polygons Convex (easy to break into triangles) For general case, three common rules: Non-exterior rule: A point is inside if every ray to infinity intersects the polygon Non-zero winding number rule: trace around the polygon, count the number of times the point is circled (+ for clockwise, - for counter clockwise). Odd winding counts = inside (note: I got this wrong in class) Parity rule: Draw a ray to infinity and count the number or edges that cross it. If even, the point is outside, if odd, it s inside (ray can t go through a vertex) Parity Any point, take any ray (that doesn t go through a vertex) Odd number of crossings = inside Even number of crossings = outside Power Point uses this rule! Winding Numbers Non-Zero Winding Rule 0 Any non-zero winding is inside What Adobe Illustrator does Odd Winding Rule / Positive Winding Rule /. Count the number of times a point is circled counter clockwise Clockwise counts negative Can pick any ray from point and count left/right Right (relative to away direction) = CCW = + Left = CW = - 0

Inside/Outside Rules Homogeneous Coordinates Polygon Non-zero Winding No. Non-exterior Parity Big idea for graphics really important Will be used for several things translation is just Basic idea: add an extra coordinate D becomes D (x matrices) D becomes 4D (4x4 matrices) Convert back from homogeneous coordinates by division (x,y) -> (x,y,) (x,y,w) -> (x/w, y/w) Projection Many points in higher dim space = point in lower dim space For now, just make w= Homogeneous Coordinates Normal space is a subspace W = Think about D case (so embed into D x,w) Many equivalent points (projection) Translation in Homogeneous Coords D Translation = D Skew W= Only D Linear operation is scale (about origin) Translation in Homogeneous Coords Translate in D = Skew in D Deck of cards What about other linear ops Just add an extra coordinate Don t change w (unless you know what you re doing)

Homogeneous Coordinates Makes translation (affine transforms) linear Need to work in higher dimensional space Useful for lots of other things Viewing (perspective) Matrices as Coordinate Systems Where does X axis go? Where does Y axis go? Where does origin go? Assumes that bottom row is [0 0 ] Can you scale by changing w? Yes, but often we prefer to renormalize so bottom right number is Composing Transformations Order matters! Scale / rotate vs. rotate/scale Can implement by multiplying matrices T T T x = (T T T ) x Why Compose? Rotate about a point T c R T -c x Scale along an axis Move point to origin Align axis w/major axis Scale Put things back T c R θ S R -θ T -c x Hierarchical coordinate Systems Matrix Stack Car Wheel Wheel Person Head / Neck Arm / forearm / hand Wheel Car Wheel T body T T RT R wheel wheel Multiply things onto the top Top is current coordinate system Push (copy the top) if you ll come back Pop to go back Think about it as moving the coordinate system Top of stack is current coordinate system Where we will draw Transformations change current coord system Or change the objects that we are going to draw

Matrix Stack Example Draw Car =. Push trans wheel pop Push trans draw car pop push trans draw car D D coordinate system & handedness Prefer right-handed coordinate systems Right-hand rule What happens in D? 4D Homogeneous Points 4x4 matrices Basic transforms are the same Translate Scale Skew Rotation is different Rotation in D is more complicated? What is a rotation? A transformation that: Preserves distances between points Preserves the zero Preserves handedness (in D clockwiseness) A subset of linear transformations Some things that come out of these: Axes remain perpindicular Axes remain unit length Cross product holds Parameterizing Rotations Rotations are Linear Transformations x matrix in D x matrix in D The set of rotations = set of OrthoNormal Matrices Inconvenient way to deal with them Can t work with them directly Not stable (small change makes it not a rotation) Is there an easier way to parameterize the set? Measuring rotation in D Pick point (,0) Any rotation must put this on a circle If you know where this point goes, can figure out any other point Distances (w/point & origin) + handedness says where things go Parameterize rotations by distance around circle Angle Issues with wrap around Many different angles = same rotation 4

Much harder in D Any point can go to a sphere That one point doesn t uniquely determine things No vector in R^n can compactly represent rotations Singularities nearby rotations / far away numbers Nearby numbers / far away rotations Hairy-Ball Theorem Any parameterization of D rotations in R^n will have singularities Representation of D Rotations Two Theorems of Euler Any rotation can be represented by a single rotation about an arbitrary axis (axis-angle form) Any rotation can be represented by rotations about fixed axes (Euler Angle form) XYZ, XZX, any non-repeating set works Each set is different (gets different singularities) Building rotations Pick a vector (for an axis) Pick another perpindicular vector (or make one w/cross product) Get third vector by cross product Euler Angles Pick convention Are axes local or global? Local: roll, pitch, yaw What order? Apply rotations Good news: numbers Bad news: Can t add, can t compose Many representations for any rotation Singularities 5