Geometric Transformations - Lecture 6 Sections 3.3, 3.7, 3

2y ago
3 Views
2 Downloads
520.46 KB
52 Pages
Last View : 5d ago
Last Download : 3m ago
Upload by : Samir Mcswain
Transcription

Geometric TransformationsLecture 6Sections 3.3, 3.7, 3.8Robb T. KoetherHampden-Sydney CollegeMon, Sep 5, 2011Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20111 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20112 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20113 / 49

PrimitivesThe three most basic types of primitive arePointLine (segment)TriangleRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20114 / 49

PointsPoints are always a single pixelRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20115 / 49

PointsLines are a sequence of pixelsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20115 / 49

PointsLines are a sequence of pixelsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20115 / 49

PointsA triangle’s interior is an area of pixelsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20115 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20116 / 49

The Coordinate AxesThere 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 sameas in the usual 2D coordinate system.The positive z-axis points towards the viewer; the negative z-axispoints away.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20117 / 49

The Coordinate AxesyxzRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20118 / 49

The Coordinate AxesyPointxzRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 20119 / 49

The Coordinate AxesyPointxyzxzRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201110 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201111 / 49

Points and Homogeneous CoordinatesPoints are represented in homogeneous coordinates (x, y , z, w),where w 6 0.The standard 3-dimensional coordinates are given by(x/w, y /w, z/w).If we use glVertex3f(), then w is set to 1.If we use glVertex2f(), then z is set to 0 and w is set to 1.Some transformations may change the w-coordinate.The w coordinate is needed for the perspective division later inthe pipeline.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201112 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201113 / 49

Geometric TransformationsDefinition (Affine Transformation)An affine transformation mapsParallel lines to parallel lines andIntersecting lines to intersecting lines.That is, an affine transform maps points at infinity to points atinfinity and finite points to finite points.If a point has w 0, then it represents a point “at infinity.”An affine transformation will map w 0 to w 0 and w 6 0 tow 6 0.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201114 / 49

Geometric TransformationsDefinition (Isometry)An isometry is an affine transformation that preserves distances nsNon-isometriesScalingsShearsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201115 / 49

2D vs. 3D TransformationsAll geometric transformations are performed in 3 dimensions,even if the drawing is in 2 dimensions.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201116 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201117 / 49

TranslationsDefinition (Translation)A translation is a displacement in a particular direction.A translation is defined by specifying the displacements x, y ,and z.x 0 x xy 0 y yz 0 z zRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201118 / 49

TranslationsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201119 / 49

Translations x 8, y 1, z 0Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201120 / 49

Translations in OpenGLThe functionglTranslatef( x, y , z)performs a translation through the displacement x, y , z.To translate an object, this function should be called before theobject is drawn.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201121 / 49

Translation ExampleExample (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();Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201122 / 49

Translation ExampleExample (Translations)Lecture 6 Demo 1 - Translate a house.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201123 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201124 / 49

RotationsDefinition (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 arex 0 x cos θ y sin θy 0 x sin θ y cos θz0 zRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201125 / 49

RotationsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201126 / 49

Rotationsz-axis, θ 60 Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201127 / 49

Rotations in OpenGLThe functionglRotatef(θ, a, b, c)will rotate about the line x at, y bt, z ct through an angle θ,measured in degrees.Typically, we rotate aboutThe x-axis (1, 0, 0), orThe y -axis (0, 1, 0), orThe z-axis (0, 0, 1).Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201128 / 49

Rotation ExampleExample (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();Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201129 / 49

Direction of RotationThe direction of rotation is determined by the “right-hand rule.”If you point your thumb in the positive direction of the axis ofrotation, then when you curl your fingers, they will curl in thepositive direction of rotation.This rule works even if you are left-handed, as long as you useyour right hand.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201130 / 49

Rotation ExampleExample (Rotations)Lecture 6 Demo 2 - Rotate a house.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201131 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201132 / 49

ScalingDefinition (Scaling)A scaling is an expansion or contraction in the x, y , and z directions byscale factors sx , sy , and sz , and centered at a point (a, b, c).Generally we center the scaling at the origin.x 0 sx xy 0 sy yz 0 sz zRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201133 / 49

ScalingRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201134 / 49

Scalingsx 3, sy 2, sz 1Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201135 / 49

Scalings in OpenGLThe functionglScalef(s x, s y , s z)will scale the drawing by factors sx , sy , and sz in the x-, y -, andz-directions.The center of the scaling is the origin.Never use a scale factor of 0.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201136 / 49

Scaling ExampleExample (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();Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201137 / 49

Scaling ExampleExample (Scalings)Lecture 6 Demo 3 - Scale a house.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201138 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201139 / 49

ReflectionsDefinition (Reflection)A reflection is a reversal of an object with respect to a line in 2dimensions or a plane in 3 dimensions.Generally we reflect in a line or plane through the origin.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201140 / 49

ReflectionsRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201141 / 49

Reflection in the x-AxisRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201142 / 49

Reflection in the y -AxisRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201143 / 49

Reflection in the Line y xRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201144 / 49

Reflections in OpenGLThe functionglScalef(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, useglScalef(1.0, -1.0, 1.0);Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201145 / 49

Reflection ExampleExample (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();Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201146 / 49

Reflection ExampleExample (Reflections)Lecture 6 Demo 4 - Reflect a house.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201147 / 49

Outline1Primitives2The Coordinate Axes3Homogeneous Coordinates4Geometric tions5AssignmentRobb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201148 / 49

HomeworkHomeworkRead Section 3.3 – transformations.Read Section 3.7 – affine transformations.Read Section 3.8 – translations, rotations, and scalings.Robb T. Koether (Hampden-Sydney College)Geometric TransformationsMon, Sep 5, 201149 / 49

Geometric Transformations Lecture 6 Sections 3.3, 3.7, 3.8 Robb T. Koether Hampden-Sydney College Mon, Sep 5, 2011 Robb T. Koether (Hampden-Sydney College) G

Related Documents:

Introduction of Chemical Reaction Engineering Introduction about Chemical Engineering 0:31:15 0:31:09. Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Lecture 25 Lecture 26 Lecture 27 Lecture 28 Lecture

transformations performing geometric exchanges based on the vertical and horizontal locations. The performance of the geometric transformations on quantum images, GI, is based on the function, G, on the computational basis vectors. The general structure of circuits for geometric transformations

Geometric transformations Geometric transformations will map points in one space to points in another: (x',y',z') f(x,y,z). These transformations can be very simple, such as scaling each coordinate, or complex, such as non-linear twists and bends. We'll focus on transformations that ca

Geometric Transformations Changes in size, shape are accomplished with geometric transformation. It alter the coordinate descriptions of object. The basic transformations are Translation, Roatation, Scaling. Other transformations are Reflection and shear.Basic transformations u

level of abstraction and look at how geometric transformations are used to alter the view of a 2D model: how we can translate, scale, and rotate the model, and how transformations affect what the viewport 'sees' Geometric Transformations Secti

Jan 26, 2018 · Geometric Transformations, 8DOF Transform Lecture #5 Friday January 26, 2018. Classes of Image Transformations Rigid transformations –Combine rotation and translation –Preserve relative distances and angles –3 Degrees of freedom Similarity transfor

The formula for the sum of a geometric series can also be written as Sn a 1 1 nr 1 r. A geometric series is the indicated sum of the terms of a geometric sequence. The lists below show some examples of geometric sequences and their corresponding series. Geometric Sequence Geometric Series 3, 9, 27, 81, 243 3 9 27 81 243 16, 4, 1, 1 4, 1 1 6 16 .

An introduction to Russian Language § ª« Information for teachers Over 150 million people speak Russian, making it the 8th most commonly spoken language in the world. In the UK, about 65,000 people speak Russian as one of their main languages. It is also spoken in many other countries, such as Uzbekistan, Belarus, Latvia,