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

Similar documents
Computer Graphics: Geometric Transformations

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z);

Computer Graphics. Chapter 7 2D Geometric Transformations

Computer Graphics Geometric Transformations

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

CS 4204 Computer Graphics

CSC 470 Computer Graphics

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

Computer Graphics 7: Viewing in 3-D

Overview. By end of the week:

1 EquationsofLinesandPlanesin 3-D

Lecture 5b. Transformation

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

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

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

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

Transformations. CSCI 420 Computer Graphics Lecture 4

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

window World space (Object space)

Viewing and Projection

Computer Science 336 Fall 2017 Homework 2

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

Lines and Planes in 3D

GL_MODELVIEW transformation

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

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

Introduction to Computer Graphics 4. Viewing in 3D

Transforms. COMP 575/770 Spring 2013

UNIT 2 2D TRANSFORMATIONS

Name: [20 points] Consider the following OpenGL commands:

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

Rotations and Translations

Section 13.5: Equations of Lines and Planes. 1 Objectives. 2 Assignments. 3 Lecture Notes

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc.

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

Transformations. Mike Bailey. Oregon State University. Oregon State University. Computer Graphics. transformations.

Transformations. Examples of transformations: shear. scaling

6. Modelview Transformations

Answers to practice questions for Midterm 1

1.5 Equations of Lines and Planes in 3-D

2D Object Definition (1/3)

The points (2, 2, 1) and (0, 1, 2) are graphed below in 3-space:

Coordinate transformations. 5554: Packet 8 1

Game Engineering CS S-05 Linear Transforms

The Three Dimensional Coordinate System

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Viewing and Projection

Unit 3 Transformations and Clipping

(Refer Slide Time: 00:04:20)

Geometry: Unit 1: Transformations. Chapter 14 (In Textbook)

Homework 5: Transformations in geometry

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

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

Section III: TRANSFORMATIONS

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

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Vector Algebra Transformations. Lecture 4

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

Viewing with Computers (OpenGL)

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

CT5510: Computer Graphics. Transformation BOCHANG MOON

Mathematics (

Projection Lecture Series

Lecture 9: Transformations. CITS3003 Graphics & Animation

Transformations IV. Week 3, Wed Jan 20

Introduction to Transformations. In Geometry

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

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

Transformations. CSCI 420 Computer Graphics Lecture 5

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

Forward kinematics and Denavit Hartenburg convention

Computer Graphics. Chapter 10 Three-Dimensional Viewing

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

Viewing and Projection

Computer Graphics Seminar

2D TRANSFORMATIONS AND MATRICES

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

2D and 3D Transformations AUI Course Denbigh Starkey

12.5 Lines and Planes in 3D Lines: We use parametric equations for 3D lines. Here s a 2D warm-up:

Lesson 9 Reflections Learning Targets :

Rectangular Coordinates in Space

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

Math (Spring 2009): Lecture 5 Planes. Parametric equations of curves and lines

Homogeneous coordinates, lines, screws and twists

Chapter 3 - Basic Mathematics for 3D Computer Graphics

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

The Projection Matrix

Affine Transformations in 3D

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

12.4 Rotations. Learning Objectives. Review Queue. Defining Rotations Rotations

Perspective projection and Transformations

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Computer Graphics: Viewing in 3-D. Course Website:

Questions HW1 Transform Q/A. Transform. Shaoting Zhang. May 11, 2008

Modeling Objects by Polygonal Approximations. Linear and Affine Transformations (Maps)

Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical Modeling

Transcription:

Lecture 6 Sections 4.3, 4.6, 4.7 Hampden-Sydney College Wed, Sep 9, 2009

Outline 1 2 3 4

re are three mutually orthogonal axes: the x-axis, the y-axis, and the z-axis. In the standard viewing position, the x- and y-axes look the same as in the usual 2D coordinate system. positive z-axis points towards the viewer; the negative z-axis points away.

y x z

y Point x z

y Point x y z x z

Points and Points are represented in homogeneous coordinates (x, y, z, w), where w 0. standard 3-dimensional coordinates are given by (x/w, y/w, z/w). For this reason, we usually want w = 1. However, some transformations may change the w-coordinate.

Definition (Isometry) An isometry is a geometric transformation that preserves distances and angles. Isometries Non-isometries Shears

2D vs. 3D All of these transformations may be performed in 2 or 3 dimensions. When they are performed in 2 dimensions, typically the z-coordinate of the points is 0. y are handled the same way whether in 2 or 3 dimensions.

Definition (Translation) A translation is a displacement in a particular direction. A translation is defined by specifying the displacements x, y, and z. x = x + x y = y + y z = z + z

x = 8, y = 1, z = 0

in OpenGL function gltranslate*( x, y, z) performs a translation through the displacement x, y, z. To translate an object, this function should be called before the object is drawn.

Translation Example Example (Translation) gltranslatef(4.0, 2.0, -3.0); glbegin(gl_triangles); glvertex3f(0.0, 0.0, 0.0); glvertex3f(1.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glend();

Translation Example Example () code. executable.

Definition (Rotation) A rotation turns about a point (a, b) through an angle θ. Generally we rotate about the origin. Using the z-axis as the axis of rotation, the equations are x = x cos θ y sin θ y = x sin θ + y cos θ z = z

z-axis, θ = 60

in OpenGL function glrotate*(θ, a, b, c) will rotate about the line x = at, y = bt, z = ct through an angle θ, measured in degrees. Typically, we rotate about x-axis (1, 0, 0), y-axis (0, 1, 0), or z-axis (0, 0, 1).

Rotation Example Example (Rotation) glrotatef(90.0, 0.0, 0.0, 1.0); glbegin(gl_triangles); glvertex3f(0.0, 0.0, 0.0); glvertex3f(1.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glend();

Direction of Rotation direction of rotation is determined by the right-hand rule. If you point your thumb in the positive direction of the axis of rotation, then when you curl your fingers, they will curl in the positive direction of rotation. This rule works even if you are left-handed, as long as you use your right hand.

Rotation Example Example () code. executable.

Scaling Definition (Scaling) A scaling is an expansion or contraction in the x, y, and z directions by scale factors s x, s y, and s z, and centered at a point (a, b, c). Generally we center the scaling at the origin. x = s x x y = s y y z = s z z

Scaling

Scaling sx = 3, s y = 2, s z = 1

in OpenGL function glscale*(s_x, s_y, s_z) will scale the drawing by factors s x, s y, and s z in the x-, y-, and z-directions. center of the scaling is the origin. Never use a scale factor of 0.

Scaling Example Example (Scaling) glscalef(4.0, 2.0, 1.0); glbegin(gl_triangles); glvertex3f(0.0, 0.0, 0.0); glvertex3f(1.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glend();

Scaling Example Example () code. executable.

Definition (Reflection) A reflection is a reversal of an object with respect to a line in 2 dimensions or a plane in 3 dimensions. Generally we reflect in a line or plane through the origin.

Reflection in the x-axis

Reflection in the y-axis

Reflection in the Line y = x

in OpenGL function glscale*(sx, sy, sz) will perform a reflection if two of the factors are 1 and one is 1. For example, to reflect in the y-axis, use glscalef(1.0, -1.0, 1.0);

Reflection Example Example (Reflection) glscalef(1.0, -1.0, 1.0); glbegin(gl_triangles); glvertex3f(0.0, 0.0, 0.0); glvertex3f(1.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glend();

Reflection Example Example () code. executable.

If we reflect in two axes at once (or in sequence), that amounts to a rotation of 180 in the axis perpendicular to those two axes. For example, glscalef(-1.0, -1.0, 1.0); is equivalent to glrotatef(180.0, 0.0, 0.0, 1.0);

To accomplish a reflection in an arbitrary line L: ax + by = 0 through the origin, First, reflect in the x-axis (y = 0). n rotate through twice the angle between the line L and the x-axis.

To accomplish a reflection in an arbitrary plane P : ax + by + cz = 0 through the origin, First, reflect in the xy-plane (z = 0). n rotate through twice the angle between the plane P and the xy-plane and about the line of intersection between the plane P and the xy-plane.

Homework Homework Read Section 4.3 transformations. Read Section 4.6 affine transformations. Read Section 4.7 translations, rotations, and scalings.