affine geometry jehee lee seoul national university
TRANSCRIPT
![Page 1: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/1.jpg)
Affine Geometry
Jehee Lee
Seoul National University
![Page 2: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/2.jpg)
Geometric Programming
• A way of handling geometric entities such as vectors, points, and transforms.
• Traditionally, computer graphics packages are implemented using homogeneous coordinates.
• We will review affine geometry and coordinate-invariant geometric programming.
• Because of historical reasons, it has been called “coordinate-free” geometric programming
![Page 3: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/3.jpg)
Example of coordinate-dependence
• What is the “sum” of these two positions ?
Point p
Point q
![Page 4: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/4.jpg)
If you assume coordinates, …
• The sum is (x1+x2, y1+y2)– Is it correct ?– Is it geometrically meaningful ?
p = (x1, y1)
q = (x2, y2)
![Page 5: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/5.jpg)
If you assume coordinates, …
p = (x1, y1)
q = (x2, y2)
Origin
(x1+x2, y1+y2)
• Vector sum– (x1, y1) and (x2, y2) are considered as vectors from the origin to p
and q, respectively.
![Page 6: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/6.jpg)
If you select a different origin, …
p = (x1, y1)
q = (x2, y2)
Origin
(x1+x2, y1+y2)
• If you choose a different coordinate frame, you will get a different result
![Page 7: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/7.jpg)
Vector and Affine Spaces
• Vector space– Includes vectors and related operations– No points
• Affine space– Superset of vector space– Includes vectors, points, and related operations
![Page 8: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/8.jpg)
Points and Vectors
• A point is a position specified with coordinate values.• A vector is specified as the difference between two points.• If an origin is specified, then a point can be represented by a vector
from the origin.• But, a point is still not a vector in coordinate-free concepts.
Point p
Point qvector (p-q)
![Page 9: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/9.jpg)
Vector spaces
• A vector space consists of– Set of vectors, together with– Two operations: addition of vectors and multiplication
of vectors by scalar numbers
• A linear combination of vectors is also a vector
VcccV NNN uuuuuu 110010 ,,,
![Page 10: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/10.jpg)
Affine Spaces
• An affine space consists of– Set of points, an associated vector space, and– Two operations: the difference between two points
and the addition of a vector to a point
![Page 11: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/11.jpg)
Coordinate-Free Geometric Operations
• Addition• Subtraction• Scalar multiplication• Linear combination• Affine combination
![Page 12: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/12.jpg)
Addition
u
vu + v
p
p + w
u + v is a vector p + w is a point
w
u, v, w : vectorsp, q : points
![Page 13: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/13.jpg)
Subtraction
v
u - vu
q
p
u - v is a vector p - q is a vector
p - q
p
p - w
p - w is a point
-w
u, v, w : vectorsp, q : points
![Page 14: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/14.jpg)
Scalar Multiplication
scalar • vector = vector
1 • point = point
0 • point = vector
c • point = (undefined) if (c≠0,1)
![Page 15: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/15.jpg)
Linear Combination
vvvvv
NN
N
iii cccc 1100
0
• A linear space is spanned by a set of bases– Any point in the space can be represented as a linear
combination of bases
![Page 16: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/16.jpg)
Affine Combination
)()( 010
0
11000
ppp
pppp
N
iii
N
ii
NN
N
iii
cc
cccc
![Page 17: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/17.jpg)
Example
• (p + q) / 2 : midpoint of line pq
• (p + q) / 3 : Can you find a geometric meaning ?
• (p + q + r) / 3 : center of gravity of ∆pqr
• (p/2 + q/2 – r) : a vector from r to the midpoint of q and p
![Page 18: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/18.jpg)
Affine Frame
• A frame is defined as a set of vectors {vi | i=1, …, N} and a point o– Set of vectors {vi} are bases of the associate vector
space– o is an origin of the frame– N is the dimension of the affine space– Any point p can be written as
– Any vector v can be written as
NNccc vvvop 2211
NNccc vvvv 2211
![Page 19: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/19.jpg)
Barycentric Coordinates
• Any point p can be written as
• Letting {qi | i=0,1,…,N} be– q0 = o, and– qi = o + vi for i=1, …, N.
NNccc vvvop 2211
NN
NNN
NNN
ccc
cccc
cccc
qqq
qqq
vovoop
1100
1101
111
)1(
)()()1(
![Page 20: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/20.jpg)
Summary
![Page 21: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/21.jpg)
Matrix Representation
• Use an “extra” coordinate– In 3-dimensional spaces
• Point : (x, y, z, 1)• Vector : (x, y, z, 0)
• For example(x1, y1, z1, 1) + (x2, y2, z2, 1) = (x1+x2, y1+y2, z1+z2, 2)
point point undefined
(x1, y1, z1, 1) - (x2, y2, z2, 1) = (x1-x2, y1-y2, z1-z2, 0)
point point vector
(x1, y1, z1, 1) + (x2, y2, z2, 0) = (x1+x2, y1+y2, z1+z2, 1)
point vector point
![Page 22: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/22.jpg)
Projective Spaces
• Homogeneous coordinates– (x, y, z, w) = (x/w, y/w, z/w, 1)– Useful for handling perspective projection
• But, it is algebraically inconsistent !!
)1,0,3
2,1()3,0,2,3()2,0,2,2()1,0,0,1(
)1,0,2
1,1()2,0,1,2()1,0,1,1()1,0,0,1(
![Page 23: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/23.jpg)
OpenGL Programming
• OpenGL ( gl ) is a common graphics library which provides functions for drawings and interactive input.
• OpenGL is accessible via C or C++ programs• http://www.opengl.org
• OpenGL basic (core) library– Functions, symbols, and typesglBegin, glClear, glCopyPixels, glPolygonModeGL_2D, GL_RGB, GL_POLYGONGlbyte, Glshort, Glint, Glfloat, Gldouble
![Page 24: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/24.jpg)
Related Libraries
• OpenGL Utility (GLU)– Setting up viewing and projection matrices– Complex objects
• Line and polygon approximations• Displaying quadrics, B-splines
– Prefix glu
• OpenGL Utility Toolkit (GLUT)– Support any screen-windowing system
![Page 25: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/25.jpg)
An Example of Open GL
• Initialize OpenGL and GLUT• Initialize a drawing window• Draw a line segment
![Page 26: Affine Geometry Jehee Lee Seoul National University](https://reader036.vdocuments.us/reader036/viewer/2022081508/5697bf721a28abf838c7ec14/html5/thumbnails/26.jpg)