Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

2D and 3D Geometric Objects in Computer Graphics: Lines, Planes, and Points - Prof. Timoth, Study notes of Computer Graphics

A part of the cs 470 computer graphics course notes from west virginia university, dated september 5, 2008. It covers the basics of 2d geometric objects, including scalars, vectors, points, and their operations. The document also introduces 3d primitives, such as lines and planes, and discusses the importance of representing objects as surfaces in computer graphics.

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-3r6
koofers-user-3r6 🇺🇸

4.5

(1)

10 documents

1 / 28

Toggle sidebar

Related documents


Partial preview of the text

Download 2D and 3D Geometric Objects in Computer Graphics: Lines, Planes, and Points - Prof. Timoth and more Study notes Computer Graphics in PDF only on Docsity! Computer Graphics CS 470 Computer Science and Electrical Engineering Dept. West Virginia University September 5, 2008 CS 470 (West Virginia University) Computer Graphics September 5, 2008 1 / 28 Outline 1 2D geometric objects 2 Lines and planes in affine space 3 Lines and planes in Euclidean space 4 3D primitives Read Angel , Chapter 4 CS 470 (West Virginia University) Computer Graphics September 5, 2008 2 / 28 CS 470 (West Virginia University) Computer Graphics September 5, 2008 5 / 28 2D geometric objects Abstract 2D types and operations Scalar - a one-component property I scalar + scalar = scalar I scalar * scalar = scalar I We will consider the real numbers. Vector - a quantity with magnitude and direction I vector + vector = vector I scalar * vector = vector I Represented as a 2-element array. Point - a position in 2D (for now) space I point + vector = point I point - point = vector I Also represented as a 2-element array. CS 470 (West Virginia University) Computer Graphics September 5, 2008 6 / 28 2D geometric objects Concrete 2D types Scalar : We will consider the real numbers. Vector : Represented as a 2-element ordered set of real numbers. Point : Also represented as a 2-element ordered set of real numbers. Specifying vector components a = [ α1 α2 ] implies a choice of basis vectors v1, v2 such that a = α1v1 + α2v2. For convenience, we most often choose basis vectors e1, e2 with representations e1 = [ 1 0 ] and e2 = [ 0 1 ]. CS 470 (West Virginia University) Computer Graphics September 5, 2008 7 / 28 2D geometric objects Point operations Point-vector addition: Q + v = P Point-point subtraction: P−Q = v CS 470 (West Virginia University) Computer Graphics September 5, 2008 10 / 28 2D geometric objects Point operations Although it is mathematically incorrect to ”scale a point” (p), we can scale the vector p− p0. (Recall the point is defined as p = p0 + β1v1 + β2v2) So scaling p− p0 by α: α(p− p0) = α(β1v1 + β2v2) Adding the result to p0 yields a new point p′ in the same frame as p: p′ = p0 + α(β1v1 + β2v2) which has the representation [ αβ1 αβ2 ] . So, in the end, the result is the same as if we had considered p to be a vector. It is still important to recognize the difference between points and vectors. Later we will use a representation (homogeneous coordinates) that will allow us to distinguish between points and vectors. CS 470 (West Virginia University) Computer Graphics September 5, 2008 11 / 28 2D geometric objects Spaces Definitions: Space : A set with some operations and properties. Vector space: I set of vectors I with addition and scalar multiplication operations I Properties : Addition is commutative and associative, etc... Affine space: I set of vectors and points I with vector space operators, and the point-vector operations. I Properties : Addition is associative, etc... Euclidean space: I An affine space with the addition of an inner product operation I This allows us to measure distance between points and do geometry. CS 470 (West Virginia University) Computer Graphics September 5, 2008 12 / 28 Lines and planes in affine space Affine space : Lines We may also define a line in terms of 2 points on the line P(α) = Q + α(R− Q) When computing points on the line, the equation can be rewritten as P(α) = αR + (1− α)Q Note that the operations involved are no longer defined in affine space. This is a useful operation to have, so we define it as a valid operation called affine addition. CS 470 (West Virginia University) Computer Graphics September 5, 2008 15 / 28 Lines and planes in affine space Affine space : Affine addition Affine addition can be defined for more than 2 points: P = α1P1 + α2P2 + . . . αnPn under the condition that α1 + α2 + . . .+ αn = 1 CS 470 (West Virginia University) Computer Graphics September 5, 2008 16 / 28 Lines and planes in affine space Affine space : Planes Recall from geometry that 3 noncollinear points define a plane. In affine space, a plane can be defined as a direct extension of the parametric line. Let P,Q,R be 3 noncollinear points. Consider the line S(α) joining point P and Q. S(α) = αP + (1− α)Q Now construct a line, T , between any point S on that line and the point R. CS 470 (West Virginia University) Computer Graphics September 5, 2008 17 / 28 Lines and planes in Euclidean space Euclidean space : Dot product The dot product can be used to compute the angle between 2 vectors, u, v cos θ = u · v ||u|| ||v|| We can use the concepts of Euclidean space to obtain different forms of the line and plane definitions. Note that for all points, P, on the line defined by P0 and d we have (P− P0) · d⊥ = 0 CS 470 (West Virginia University) Computer Graphics September 5, 2008 20 / 28 Lines and planes in Euclidean space Euclidean space : Dot product We can specify a plane by specifying one point P0 on the plane, and a vector, n, perpendicular to the plane. All points, P, on the plane defined by P0 and n we have (P− P0) · n = 0 These representations of points and lines are called implicit. They don’t allow us to directly generate points on the line/plane, they do allow us to test whether a given point is on the line/plane. CS 470 (West Virginia University) Computer Graphics September 5, 2008 21 / 28 Lines and planes in Euclidean space Euclidean space : Cross product For vectors u =  uxuy uz  and v =  vxvy vz  the cross product is defined by u× v =  uyvz − uzvyuzvx − uxvz uxvy − uyvx  CS 470 (West Virginia University) Computer Graphics September 5, 2008 22 / 28 3D primitives Represent objects as surfaces, not solids. If the camera does not pass through objects, and if objects never break apart, we will only ever see the surface. This is only a visual representation, the application programmer must devise techniques to prevent objects from intersecting. CS 470 (West Virginia University) Computer Graphics September 5, 2008 25 / 28 3D primitives Store the coordinates of points on the surface. The mathematical description of surfaces can become complex, so we will work with points sampled from the surface. Image credits : Hughes Hoppe, UW We don’t require mathematical descriptions of every object we wish to render. CS 470 (West Virginia University) Computer Graphics September 5, 2008 26 / 28 3D primitives Approximate the surface using planar polygons. We are viewing the output of a raster device, so if the polygons in the surface approximation have a projected size of much less than one pixel, the resulting image will be a very good representation of the actual surface. Image credits : Henrik Jensen, UCSD We will also see techniques for shading polygons which will give the impression geometric complexity. CS 470 (West Virginia University) Computer Graphics September 5, 2008 27 / 28
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved