Download Solution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Euler angles wikipedia , lookup

System of polynomial equations wikipedia , lookup

Plane of rotation wikipedia , lookup

Möbius transformation wikipedia , lookup

Affine connection wikipedia , lookup

Rotation formalisms in three dimensions wikipedia , lookup

Riemannian connection on a surface wikipedia , lookup

Rotation matrix wikipedia , lookup

Cartesian coordinate system wikipedia , lookup

Line (geometry) wikipedia , lookup

Map projection wikipedia , lookup

Four-dimensional space wikipedia , lookup

Metric tensor wikipedia , lookup

Covariance and contravariance of vectors wikipedia , lookup

Curvilinear coordinates wikipedia , lookup

Tensors in curvilinear coordinates wikipedia , lookup

Cartesian tensor wikipedia , lookup

Rotation group SO(3) wikipedia , lookup

Transcript
521493S Computer Graphics Exercise 2 Solutions
2.1
The vector is orthogonal to and . The vector is orthogonal to and
. Hence, , and form an orthogonal coordinate system.
Note that may not be orthogonal to and therefore can’t be part of coordinate system.
For the second part we need to actually calculate the cross product between two vectors:
With 1
2 3 and 2
3 4 , we can solve second basis vector 2·43·3
1
3 · 2 1 · 4 2 1·32·2
1
We can then solve using and 2 · 1 3 · 2
8
3 · 1 1 · 1! 2
1 · 2 2 · 1
4
We can check the result by making sure that the dot products · · · 0:
· $ · $ % · % & · $ $ ' & ( ok!
· $ · , % · % & · ' , ' $% ( ok!
2.2
· $ · , % · % $ · ' , ' ' ( ok!
There are 12 degrees of freedom in the three-dimensional affine transformation.
.
.
-
.
0
.
.
.
0
.
.
.
0
./
./
!
./
1
Suppose we consider a point 0 1, 3, 4, 1 that is transformed to 05 15, 35, 45, 1 by the
matrix -. Hence we have the relationship 06 -0 where - has 12 unknown coefficients
but 0 and 05 are known. Thus we have 3 equations in 12 unknowns (the fourth equation is
simply the identity 1 1).
1 6 . 1 . 3 . 4 ./
3 6 . 1 . 3 . 4 ./
4 6 . 1 . 3 . 4 ./
10·10·30·41
If we have 4 such pairs of points we will have 12 equations in 12 unknowns which could be
solved for the elements of -. Thus if we know how a quadrilateral is transformed we can
determine the affine transformation.
In two dimensions, there are 6 degrees of freedom in - but 0 and 05 have only 1 and 3
components.
.
- 7.
0
.
.
0
.
. 8
1
Hence if we know 3 points both before and after transformation, we will have 6 equations in
6 unknowns and thus in two dimensions if we know how a triangle is transformed we can
determine the affine transformation.
2.3
Transformation order is from right to left. So rotation around y-axis is on the right side of the
rotation matrix. NOTE: In the original version 9 : matrix had wrong signs!
cos<
0
9 ; < =
sin<
0
0
1
0
0
sin<
0
cos<
0
cos < sin <
sin < cos <
9 : < =
0
0
0
0
0
0
1
0
0
0
B
0
1
0
0
B
0
1
We are using 45 degree angles to rotate and cos45° sin45° 1
1
H
√2
G√2
1
1
9 9 : 45°9 ; 45° G
G√2 √2
G0
0
F0
0
2.4
√2 1
H 1
1 1
1
√2
G
2 G√2
0
√2
F 0
0
0
1
0 0K H
J G √2
0
0 0J G 1
J G
1 0J G √2
0 1I F 0
0K
0J
0J
2I
0
1
0
0
1
√2
0
1
√2
0
√
1
1
H
0K G 2
√2
1
J G 1
0J G
2
√2
0J GG 1
J
0
1I G √2
F 0
0
1
2
1
2
1
0K
J
J
0J
J
0J
J
√2
0 1I
Eclipses (both solar and lunar) are good examples of the projection of an object (the moon or
the earth) on to a nonplanar surface. All the maps in an atlas are examples of the use of
curved projectors. If the projectors were not curved we could not project the entire surface
of a spherical object (the earth) onto a rectangle.
2.5
We are projecting point 0 x, y, z, 1 using projection matrix - to point 06 1 6 , 3 6 , 4 6 , 1 .
06 -0
Z-axis is projected to the same plane with x and y axes with a -135 degree angle from
positive x axis:
1 6 1 O cos135° 4
3 6 3 O sin135° 4
46 0
11
Here O is the length of the vector as it has not been given. We can select PO cos135°P PO sin135°P 1 to obtain a simple looking projection matrix.
1
0
-=
0
0
2.6
0
1
0
0
1
1
0
0
0
0
B
0
1
All the points on the projection of the point 1, 3, 4 in the direction QR , Q; , Q: are of the
form 1 OQR , 3 OQ; , 4 OQ: . Thus the shadow of the point 1, 3, 4 is found by
determining the O for which the line intersects the plane, that is
S1T U3T V4T Q 0
Substituting and solving, we find
O
Q S1 U3 V4
.
SQR UQ; VQ:
However, what we want is a projection matrix. Using this value of O we find
1T 1 OQR 3T 3 OQ; 4T 4 OQ: XUQ; VQ: Y1 UQR 3 VQR 4 QQR
SQR UQ; VQ:
XSQ; Y1 SQR VQ: 3 XVQ; Y4 QQ;
SQR UQ; VQ:
SQ: 1 UQ: 3 XSQR UQ; Y4 QQ:
SQR UQ; VQ:
These results can be computed by multiplying the homogenous coordinate point 1, 3, 4, 1
by the projection matrix.
UQ; VQ:
H
SQ;
- GG
SQ:
G
0
F
UQR
SQR VQ:
UQ:
0
VQR
VQ;
SQR UQ;
0
QQR
K
QQ;
J
J
QQ:
J
SQR UQ; VQ: I