Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Projection Types and Formulas for Transforming 3D to 2D Coordinates
1.
2. Projections: Transform points in coordinate system of
dimension N into a coordinate system of dimension less
than N.
In other word, take a point from m dimensions to n
dimensions where N<M.
In this chapter we will deal with projection from 3d to
2d
There are two types of projections:
1. Parallel.
Orthographic.
Oblique.
2. Perspective.
3. Projection of a 3D object is defined by straight
projection rays (projectors) coming from the center of
projection passing through each point of the object and
intersecting the projection plane.
Projections requires:
1. Projections plane.
2. Projections Reference Point (PRP) or Center of
Projection (CRP).
The projected view of an object is determined by
calculating the intersection of projection lines with the
view plane.
Projectors: Lines from coordinate in original space to
coordinate in projected space.
4. In parallel projections, coordinate positions are
transformed to the view plane (projection plane) along
parallel lines (projectors).
In perspective, object position are transformed to the
view plane along lines that converge to COP.
In orthographic the direction of projection = normal to
the projection plane.
In oblique the direction of projection != normal to the
projection plane.
Direction/Center of projection: The main key factors in
projection are DOP and COP.
5. If the DOP is the same for all point, then we have
parallel projection, else we have perspective projection.
If the distance of COP is finite, then we have
perspective projection, else we have parallel projection.
In general, projection is determined by where you
place the projection plane relative to principle axes of
object (relative angle and position), and what angle the
projection make within the projection plane.
6. Perspective:
Size varies inversely with distance (Looks realistic).
Distance and angle are not preserved.
Parallel lines do not remain parallel.
Parallel:
Less realistic.
Angles are not preserved.
Parallel lines remain parallel.
Good for exact measurement.
7.
8. In Orthographic there is no COP at infinity and A=A’
and B=B’, but in Oblique COP at infinity
9. Perspective projection of a point P with coordinates
(X,Y,Z) to position (X’,Y’,Z’) on the view plane.
10. X’= X - XU.
Y’= Y - YU.
Z’= Z – (Z-ZPRP).
Parameter U takes values from 0 to 1.
When U= 0.
X’= X. Orthographic parallel projection
Y’= Y.
When U= 1.
X’= 0
Y’= 0 (0,0,ZPRP) so the point is at projection
Z’= ZPRP. Reference point PRP
11. On the view plane Z’= ZVP.
U= (ZVP – Z) / (ZPRP – Z).
XP= X ((ZPRP – ZVP) / (Z – ZPRP)) = X (dP / (Z-ZPRP))
YP= Y ((ZPRP – ZVP) / (Z – ZPRP)) = Y (dP / (Z-ZPRP))
Where dP = ZPRP – ZVP is the distance of the view plane
VP from the projection reference plane PRP.
Using 3d homogeneous-coordinate representation, we
can write the perspective projection transformation as
12. Xh = X.
Yh = Y.
Zh = Z (ZVP / dP) – ZVP (ZPRP / dP).
h= (Z / dP) – (ZPRP / dP)
XP = Xh / h.
YP = Yh / h.
13. EX: If you have a point (2,4,6) and you want to project
using perspective projection, suppose that ZPRP=20 and
ZVP=10.
dP= ZPRP – ZVP= 20-10 = 10.
XP= X (dP / (Z-ZPRP))= 2 (10/-14).
YP= Y (dP / (Z-ZPRP))= 4 (10/-14).
Using 3d homogenous coordinate:
Xh = 2, Yh = 4.
h= (6 / 10) – (20 / 10)= -14/10.
XP = 2 / (-14/10)= 20/-14.
YP = 4 / (-14/10)= 40/-14.
14. Oblique projection of coordinate position (X,Y,Z) to
position (XP,YP) on the view plan.
15. X’= L * Cos θ.
Y’= L * Sin θ.
XP= X + X’= X + L * Cos θ.
YP= Y + Y’= Y + L * Sin θ.
Length L depends on the angle α and the Z coordinate of
the point to be projected
Tan α= Z/L.
L= Z/tan α= ZL1, where L1 is the inverse of tan α which
is also the value of L when Z = 1. We can then write the
oblique projection equations as:
XP= X + Z(L1 Cos θ).
YP= Y + Z(L1 Sin θ).
16. X’= L * Cos θ.
An orthographic projection obtained when L= 0.
Common choices for θ in 30 and 45, which display a
combination view of the top, bottom and sides.
17. EX: If you have a point (2,5,7) and you want to project
using oblique projection, suppose that θ=45 and α=45.
L1= 1/tan α= 1.
XP= X + Z(L1 Cos θ)= 2 + 7(1 Cos 45)= 2+(7/ 2).
YP= Y + Z(L1 Sin θ)= 5 + 7(1 Sin 45)= 5+(7/ 2).
18. EX: If you have a point (3,4,6) and you have θ=45,α=45,
ZPRP=5 and ZVP=2. Find the new coordinate using :
(A)Perspective (B)Orthographic (C)Oblique.
(A) dP= ZPRP – ZVP= 5-2 = 3.
XP= X (dP / (Z-ZPRP))= 3 (3/1)= 9.
YP= Y (dP / (Z-ZPRP))= 4 (3/1)= 12.
(B) XP= 3, YP= 4 Just drop Z.
(C) L1= 1/tan α= 1.
XP= X + Z(L1 Cos θ)= 3 + 6(1 Cos 45)= 3+(6/ 2).
YP= Y + Z(L1 Sin θ)= 4 + 6(1 Sin 45)= 4+(6/ 2).