0% found this document useful (0 votes)
30 views74 pages

3D Transformations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views74 pages

3D Transformations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 74

Chapter 8

3-D Transformations
3D Coordinate System
• Distance Formula
D = sqrt((x1 – x0)2 + (y1 – y0) 2 +( z1 – z0) 2)

• Equations of Line
– Parametric form:
x = x0+(x1 – x0).t
y = y0+(y1 – y0).t 0≤ t ≤1
z = z0+(z1 – z0).t
– Implicit Form:
y = m1x+b1
z = m2x+b2

November 29, 2024 Computer Graphics 6


3D Coordinate System
• Equations of Surface: Surface has both breadth and width
– Parametric form:
x = f(s,t)
y = g(s,t) 0≤s, t ≤1
z = h(s,t)
– Non Parametric Explicit Form:
z = f(x,y)
e.g. z = ax+by+c
– Non Parametric Implicit Form:
F(x,y,z) = 0
Ax+By+Cz+D = 0

November 29, 2024 Computer Graphics 8


Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations

November 29, 2024 Computer Graphics 9


Vector Fundamentals
• In 3D there are 3 natural coordinate vectors I, J and K having
unit along X, Y and Z axis respectively.

y axis

• Any vector V = aI+bJ+cJ can be


y V=aI+bJ+cK
resolved into three components
(a,b,c) that represent corresponding
point when the tail of V is placed at P (a,b,c)
the origin.
z
x

z axis x axis
November 29, 2024 Computer Graphics 10
Vector Fundamentals
• If P(x0,y0,z0) and Q(x1,y1,z1) are two points in space then
PQ = (x1 – xo)I+ (y1 – yo)J+ (z1 – zo)K
y axis

• Vector has two attributes: y V=aI+bJ+cK


– length- a scalar denoted by |v|
– direction in 3D space P (a,b,c)

• Equality: Two vectors are equal if z


x
they have same length and direction
z axis x axis

November 29, 2024 Computer Graphics 11


Vector Fundamentals
1. Vector Addition: perform addition by the head-to-tail rule.
Note u+v = v+u

u
v v+u
u+v
u

November 29, 2024 Computer Graphics 12


Vector Fundamentals
2. Vector Subtraction: To perform subtraction, given u and v,
we define u - v to be u + (-v):
Note u - v ≠ v – u

u u -v
v
u-v

November 29, 2024 Computer Graphics 13


Vector Fundamentals
3. Zero Vector: i.e. vector with zero length and no direction.
v + (-v) = 0
4. Magnitude of Vector of a vector u = aI+bJ+cK is a scalar
quantity defined as:
2 2 2
u  a b c

5. Unit vector for any vector u is a vector having direction of u


and unit magnitude. It can be found as
u v
uv 
u -v
November 29, 2024 Computer Graphics 14
Vector Fundamentals
6. Scalar Multiplication: (Scalar times a vector ) Let  be a
scalar and u a vector we define u to be the vector with
length |  ||u| with
– the direction of u if  > 0
– the opposite of u if  < 0

if  = 0, the vector is the zero vector or a point.

u
2u -3u

November 29, 2024 Computer Graphics 15


Vector Fundamentals
7. Dot Product: Given two vectors u = a1I+b1J+c1K and v =
a2I+b2J+c2K the dot product of the vectors is defined to be
the scalar as follows
u.v = a1.a2+b1. b2+c1.c2
or u.v = |u| |v| cos  , 0 ≤≤
where  is the angle between u and v
Also
cos  = u.v /|u| |v|
v
Or  = cos-1(u.v /|u| |v|) θ
u
November 29, 2024 Computer Graphics 16
Vector Fundamentals
The dot product is a scalar value that tells us something
about the relationship between two vectors
– If u·v > 0 then 0<θ < 90º
• Vectors point in the same general direction
– If u·v < 0 then θ > 90º
• Vectors point in opposite direction
– If u·v = 0 then θ = 90º
• Vectors are perpendicular
• (or one or both of the vectors is degenerate (0,0,0))

November 29, 2024 Computer Graphics 17


Vector Fundamentals
8. Cross Product: Given two vectors u = a1I+b1J+c1K and v =
a2I+b2J+c2K the cross product of the vectors is defined to be
the new vector whose length is |u||v| sin , 0 ≤≤ and
direction is given by the right hand rule.
u x v = (b1.c2 – c1. b2)I+ (c1.a2 – a1. c2)J+ (a1.b2 – b1. a2)K
or |u x v| = |u| |v| sin  , 0 ≤≤ where  is the angle b/w u & v
u
sin  = |u x v| /|u| |v|
v
Or  = sin-1(|u x v| /|u| |v|)
uXv

November 29, 2024 Computer Graphics 18


Vector Fundamentals
• In a Right handed coordinate System
J
– IxJ=K
– JxK=I
– I x K = -J
or K x I = J

K I

Right-Hand
Reference System

November 29, 2024 Computer Graphics 19


Vector Fundamentals
9. Vector Equations of Line: If P(x0,y0,z0) and Q(x1,y1,z1) are
two points in space then
PQ = (x1 – xo)I+ (y1 – yo)J+ (z1 – zo)K
= t.aI+t.bt+t.ct = t(aI+bt+ct)

 x = x0+(x1 – x0).t = x0+a.t


y = y0+(y1 – y0).t = y0+b.t 0≤ t ≤1
z = z0+(z1 – z0).t = z0+c.t

November 29, 2024 Computer Graphics 20


Vector Fundamentals
10. Vector Equations of Plane: A plane can be uniquely
determined by specifying
– A reference point R0(x0,y0,z0) on the plane, and

– Normal vector N = n1I+n2J+n3K


A vector N is said to be
N the normal vector to the
plane if for any given
directed line V in the
plane V.N = 0.

P(x,y,z)
R0 P • R (x ,y ,z )
0 0 0 0

November 29, 2024 Computer Graphics 21


Vector Fundamentals
Let P(x,y,z) be any point on the plane so that vector R0P
lies on the plane.
since N  R0P
 N . R0P = 0
 (n1I+n2J+n3K). ((x-x0)I+(y-y0)J+(z-z0)K) = 0
N
 n1(x-x0)+n2(y-y0)+n3(z-z0) = 0
 n1x+n2y+n3z – (n1x0+n2y0+n3z0) = 0

P(x,y,z)
which is in R0 P •R 0

Ax + By + cZ – D = 0 form (x0,y0,z0)
November 29, 2024 Computer Graphics 22
Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations

November 29, 2024 Computer Graphics 23


3D Homogeneous Coordinates
• Similar to the 2-D situation we can use homogeneous
coordinates for 3-D transformations - 4 coordinate
y axis
column vector

• All transformations can y


then be represented
as matrices  x 
 y P
P(x, y, z) =  
 z
 
 1 z
x

November 29, 2024 z axisGraphics


Computer x
24 axis
3D Homogeneous Coordinates
• Transform a point:
 px   mxx mxy mxz d x   px   mxx px  mxy py  mxz pz  d x 
 p   m myy myz d y   py   myx px  myy py  myz pz  d y 
 y    yx     
 pz   mzx mzy mzz dz   pz   mzx px  mzy py  mzz pz  dz 
      
1  0 0 0 1 1   0  0  0 1 

 px 
  
M  py   d
 pz 

– Top three rows are the affine transform!


– Bottom row stays 1
November 29, 2024 Computer Graphics 25
3D Homogeneous Coordinates
• Transform a vector:
 vx   mxx mxy mxz d x   vx   mxx vx  mxy vy  mxz vz  0 
 v   m myy myz d y   vy   myx vx  myy vy  myz vz  0 
 y    yx     
 vz   mzx mzy mzz dz   vz   mzx vx  mzy vy  mzz vz  0 
      
 0  0 0 0 1 0  0000 

 vx 
 
M  vy 
 vz 

– Top three rows are the linear transform


• Displacement d is properly ignored
– Bottom row stays 0

November 29, 2024 Computer Graphics 26


3D Homogeneous Coordinates
• In Homogeneous arithmetic Legal operations always end in
0 or 1!      
vector+vector:  0   0   0
     
     
vector-vector:  0   0   0
     
   
scalar*vector: s    
 0  0
     
point+vector:  1   0    1
     
     
point-point:  1   1   0 
     
     
point+point:  1   1   2 
     
   
scalar*point: s    
 1  s
 weighted average  1   2    
  of points:  
 affine combination  3  1 3  1  1
 

November 29, 2024 Computer Graphics 27


3D Homogeneous Coordinates
• Rotation, Scale, and Translation of points and vectors unified
in a single matrix transformation:

 mxx mxy mxz dx 


p M p m myy myz dy 
Where M = yx 
 mzx mzy mzz dz 
 
• Matrix has the form:  0 0 0 1
– Last row always 0,0,0,1

• Transforms compose by matrix multiplication.

November 29, 2024 Computer Graphics 28


Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations

November 29, 2024 Computer Graphics 29


3D Geometric Transformations

– Geometric Transformations: In Geometric transformation an


object itself is moved relative to a stationary coordinate system
or background. The mathematical statement of this view point is
described by geometric transformation applied to each point of
the object. Various Geometric transformations are:

– Translation
– Scaling
– Rotation
– Reflection
– Shearing

November 29, 2024 Computer Graphics 31


3D Geometric Transformations
• Once we have an object described, transformations are used to
move that object, scale it and rotate it

November 29, 2024 Computer Graphics 32


Geometric Transformations
–Translation
–Scaling
–Rotation
–Reflection
–Shearing
3D Geometric Translation
Translation is defined as the displacement of any object by a
given distance and direction from its original position

November 29, 2024 Computer Graphics 34


3D Geometric Translation
• To translate a point in three dimensions by tx, ty and tz simply
calculate the new points as follows:
x’ = x + tx y’ = y + ty z’ = z + tz

(x, y, z)
(x’, y’, z’)
Translated Position

November 29, 2024 Computer Graphics 35


3D Geometric Translation
– The translation of a point P(x,y,z) by (tx, ty, tz) can be
written in matrix form as:

P Tv ( P ) where v tx I  ty J  tz K

1 0 0 tx   x  x
0  y
1 0 ty   y
T v  P   '  P  
0 0 1 tz  z  z
     
0 0 0 1 1  1 

November 29, 2024 Computer Graphics 36


Geometric Transformations
–Translation
–Scaling
–Rotation
–Reflection
–Shearing
3D Geometric Scaling
Scaling is the process of expanding or compressing the
dimensions of an object determined by the scaling factor.

November 29, 2024 Computer Graphics 38


3D Geometric Scaling
• To scale a point in three dimensions by sx, sy and sz simply
calculate the new points as follows:
x’ = sx*x y’ = sy*y z’ = sz*z

(x, y, z) (x’, y’, z’)

Scaled Position

November 29, 2024 Computer Graphics 39


3D Geometric Scaling
– The scaling of a point P(x,y,z) by scaling factors Sx, Sy
and Sz about origin can be written in matrix form as:
P Ssx , sy , sz ( P ) where
 sx 0 0 0  x  x
 0 sy 0  y
0  y
Ssx , sy , sz  P   '  P  
 0 0 sz 0 z  z
     
0 0 0 1 1  1 
 x  sx 0 0 0  x   sx x 
 y 
    0 sy 0 0  y   sy y 
such that  
 z '   0 0 sz 0  z   sz z 
       
1   0 0 0 1  1  1 
November 29, 2024 Computer Graphics 40
Geometric Transformations
–Translation
–Scaling
–Rotation
–Reflection
–Shearing
3D Geometric Rotations
• Rotate about z – axis: The picture shows a z-axis rotation
around the origin in a positive angle, (Anti-clockwise) as you
look down the z-axis towards the origin. The angle is
measured in the xy-plane from the x-axis, just as in 2D.

November 29, 2024 Computer Graphics 44


3D Geometric Rotations
• Rotate about y – axis: You are looking down the y-axis
which is not shown. A positive (counter-clockwise) angle is
shown.

November 29, 2024 Computer Graphics 45


3D Geometric Rotations
• Rotate about x – axis: You are looking down the x-axis
which is not shown. A positive (counter-clockwise) angle is
shown.

November 29, 2024 Computer Graphics 46


3D Geometric Rotations
• The equations for the three kinds of rotations in 3-D are

x’ = x·cosθ - y·sinθ x’ = x x’ = z·sinθ + x·cosθ


y’ = x·sinθ + y·cosθ y’ = y·cosθ - z·sinθ y’ = y
z’ = z z’ = y·sinθ + z·cosθ z’ = z·cosθ - x·sinθ
November 29, 2024 Computer Graphics 47
3D Geometric Rotations
– The rotation of a point P(x,y,z) by an angle of  about
different axis about origin can be written in matrix form as:
P R , axis( P )
 x  x  cos   sin  0 0
 y  y  sin  cos  0 0
where P  '  P   R , K  
z  z  0 0 1 0
     
1  1   0 0 0 1
 cos  0 sin  0 1 0 0 0
 0 1 0 0   0 cos   sin  0
R , J    R , I  
  sin  0 cos  0  0 sin  cos  0
   
 0 0 0 1  0 0 0 1
November 29, 2024 Computer Graphics 48
Geometric Transformations
–Translation
–Scaling
–Rotation
–Reflection
–Shearing
3D Geometric Reflections
• We can perform reflections relative to a selected reflection
axis or with respect to a reflection plane.
• Reflections relative to a given axis are equivalent to 180°
rotations about that axis.
• Reflections with respect to a plane are equivalent to 180°
rotations in 4D space.
• 3 standard Reflections are
– About z axis or with respect to xy plane
– About y axis or with respect to zx plane
– About x axis or with respect to yz plane

November 29, 2024 Computer Graphics 50


3D Geometric Reflections
• Reflection about XY – plane: Reflection relative to the xy
plane can be obtained from following set of equations:
x’ = x y’ = y z’ = – z
• In homogenous matrix form
1 0 0 0
0 1 0 0
P' = Mxy(P) where M xy 
0 0  1 0
 
0 0 0 1

• Reflections about other planes can also be obtained by


symmetry.
November 29, 2024 Computer Graphics 51
3D Geometric Reflections
• Reflection about XY – plane is a useful reflection as it
converts a right-handed coordinate system into a left-handed
coordinate system.
y
y

x
x
z

November 29, 2024 Computer Graphics 52


Geometric Transformations
–Translation
–Scaling
–Rotation
–Reflection
–Shearing
3D Geometric Shearing
• Similarly we can obtain Y-shears and Z shears.

• General Shearing Matrix is described in terms of %age

 1 hyx hzx 0
h 1 hzy 0
Sh  xy
 hxz hyz 1 0
 
 0 0 0 1

November 29, 2024 Computer Graphics 56


Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations

November 29, 2024 Computer Graphics 57


Inverse Transformations
1
– Inverse Translation: Tv T v
1
– Inverse Scaling: S sx ,sy ,sz S1/ sx ,1/ sy ,1/ sz

– Inverse Rotations: 1
R , p R  , p
1
– Inverse Reflections: M plane M plane

November 29, 2024 Computer Graphics 58


Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Combining transformations

November 29, 2024 Computer Graphics 59


3D Coordinate Transformations

– Coordinate Transformation: The object is held


stationary while coordinate system is moved relative
to the object. These can easily be described in terms
of the opposite operation performed by Geometric
transformation.

November 29, 2024 Computer Graphics 60


3D Coordinate Transformations
– Coordinate Translation: 1
T v Tv T v
1
– Coordinate Scaling: S sx ,sy ,sz S sx ,sy ,sz S1/ sx ,1/ sy ,1/ sz
1
– Coordinate Rotations: R , p R , p R  , p

– Coordinate Reflections: 1
M plane M plane M plane

November 29, 2024 Computer Graphics 63


Contents
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations

November 29, 2024 Computer Graphics 64


Composite Transformation
• Various composite transformations are

1. Scaling about arbitrary point P


2. Tilting as rotation about x-axis followed by y-axis
3. Aligning vector V with K (Z – axis)
4. Rotation about arbitrary axis L
5. Mirror Reflection about arbitrary plane (N, R0)

November 29, 2024 Computer Graphics 66


Exercise 1
Scaling about arbitrary point P
– Imagine scaling an object around a point (a,b,c) other than the origin
• Translate point (a,b,c) to origin
• Scale around origin
• Translate back to point

November 29, 2024 Computer Graphics 67


Exercise 1

November 29, 2024 Computer Graphics 68


Exercise 1
Let P is the object point which is to be scaled by factors sx, sy and sz about the
fixed point (a,b,c). Then the composite transformation S sx,sy,sz,(a,b,c) can be
obtained by performing following sequence of transformations :
1. Translate (a,b,c) to origin and the new object point is found as
P1 = TV(P) where V= – aI – bJ– cK
2. Scale object about origin and the new object point is
P2 = Ssx,sy,sz(P1)
3. Retranslate (a,b,c) back the final object point is
PF = T-1V(P2) = T-V (P2)
The composite transformation can be obtained by back substituting
PF = T-1V(P2)
= T-V Ssx,sy,sz(P1)
= T-V Ssx,sy.TV(P) where V= – aI – bJ– cK

November 29, 2024 Computer Graphics 69


Exercise 1
Thus we form the matrix to be Ssx,sy,sz(a,b,c)= T-VSsx,sy,szTV
And the composite scaling transformation matrix is

1 0 0 a   sx 0 0 0  1 0 0  a
0 1 0 b   0 sy 0 0  0 1 0  b 

S sx , sy , sz ( a ,b ,c )  
0 0 1 c   0 0 sz 0  0 0 1  c
     
0 0 0 1   0 0 0 1  0 0 0 1
 sx 0 0  a.sx  a 
 0 sy 0  b.sy  b 
 
 0 0 sz  c.sz  c 
 
 0 0 0 1 
November 29, 2024 Computer Graphics 70
Exercise 3
Z axis
Aligning vector V with Vector K
Let V = aI+bJ+cK then the alignment can be
performed by following sequence of
operations:
P(a,b,c)
•Rotate V about X-axis by an angle of 1, so
c
that V rotates into upper -half of the xz – V
plane. V’= R1,I(V)
a b
Y axis
•Rotate V’ about Y-axis by an angle of -2,
so that V’ rotates and align with Z – axis.
V”= R - ,J(V ’).
2
X axis
How to get these two angles???
November 29, 2024 Computer Graphics 72
Exercise 3
Z axis

Step1: Rotate V about X-axis by an angle of


1, so that V rotates into upper -half of the xz
V’
– plane. V’= R ,I(V) C P’(0,b,c)
1
Q(a,0,b2+c2
P(a,b,c)
Let P’ be projection of P(a,b,c) in YZ plane. V
1
P’↔(0,b,c). If 1 be the angle that OP
makes with +ve Z-axis, then from OP’C O B
b Y axis
sin 1  A
b2  c2
c
cos 1 
b2  c2 X axis

November 29, 2024 Computer Graphics 73


Exercise 3

Rotate vector V about X-axis by an angle of 1

V’= R1,I(V) or Q = R (P)


1,I

Where 1 0 0 0 b
 0 cos   sin 1 0
sin 1 
b2  c2
R1 , I  1

 0 sin 1 cos 1 0 cos 1 


c
  b2  c2
0 0 0 1

Does V have rotated into upper -half of the xz – plane?

November 29, 2024 Computer Graphics 74


Exercise 3
1 0 0 0  a 
 0 cos   sin  0   b
Q R1 , I ( P )  1 1  
 0 sin 1 cos 1 0  c 
  
 0 0 0 1   1
1 0 0 0  a 
 c b   a  cb  bc 
 0  0   b  2 2 
b 2
 c 2
b 2
 c 2
 .   2 b  c 
 b c 2
0 0  c   b c 
 b2  c2 b2  c2   1  b2  c2 
0 0 0 1   
1

   
 a 
 0 
 
 b c 
2 2

 
 1 
November 29, 2024 Computer Graphics 75
Exercise 3
Z axis

R(0,0,a2+b2+c2)
Step2: Rotate V’ about Y-axis by an angle
Q’(0,0,b2+c2)
of – 2 , so that V’ aligns with +ve Z axis.
V’
V”= R1,I(V) a P’(0,b,c)
Q(a,0,b2+c2) C P(a,b,c)
Let Q’ be projection of Q(a,0,b2+c2) on Z 2 V
axis, Q’↔(0,0, b2+c2 ). If 2 be the angle
that OQ’ makes with +ve Z-axis, then from
O B
OQQ’ a Y axis
sin  2  A
a2  b2  c2
b2  c2
cos  2  X axis
a2  b2  c2
November 29, 2024 Computer Graphics 76
Exercise 3

Rotate vector V’ about Y-axis by an angle of – 2

V”= R-2,J(V’) or R = R- (Q)


2,J

Where
 cos 1 0  sin  2 0 a
 0 sin  2 
1 0 0 a2  b2  c2
R  2 , J 
 sin  2 0 cos  2 0 b2  c2
  cos  2 
 0 0 0 1 a2  b2  c2

Does V have aligned Z axis?

November 29, 2024 Computer Graphics 77


Exercise 3
 cos  2 0  sin  2 0  a 
 0 1 0 0  0 
R R  2 , J (Q )  
 sin  2 0 cos  2 0  b  c 2 2

  
 0 0 0 1  1 
 b2  c2 a 
 0  0  a 
2 2 2 2 2 2
 a b c a b c  
 0 1 0 0   0 
 2 2
.
  b c 
2 2
a b c
 0 0  
2
 a b c 2 2 2
a b c 2 2
 1 
 0 0 0 1
 a b2  c2  a b2  c2 
 2 2 2
  0 
 a b c   
0
 0   
 2
a b c 2 2
  a b c  2 2 2

 2 2 2
  
 a  b  c   1 
November 29, 2024  1 Computer Graphics
 78
Exercise 3
Composite Matrix AV,K can be found as
R R  2 , J (Q) R  2 , J * R1 , I ( P ) 
 b2  c2 a  1 0 0 0
 0  0  c b 
 a2  b2  c2 a2  b2  c2  0 2 2
 0
b c b2  c2
 0 1 0 0 .
 b c

a b  c2
2
0
 0 0  0 
 a2  b2  c2 a 2  b2  c2  b2  c2 b2  c2
 0 0 0 1  0 0 0 1

   ab ac 
  a  V  0
V 0  0  1 0 0 0 V V
V  c b   
  0  0  0 c b
0 1 0 0 .   0   b2  c2
 a   b c      where
 0 
0 0 0  a b c  V  a2  b2  c2
V V      0
 0
 0 0 1  0 0 0 1 V V V 
 0 0 0 1

November 29, 2024 Computer Graphics 79


Exercise 3
Corollary: The inverse of AV,K can be found as

A 1V , K ( R  2 , J . R1 , I )  1
1 1
R 1 , I .R  2 ,J
T T
R 1 , I .R  2 ,J
T
( R  2 , J . R1 , I )
T
( AV , K )
T
A V ,K

November 29, 2024 Computer Graphics 81


Exercise 5
Rotation by an angle  about arbitrary axis L specified by a
direction vector V and fixed point P0.
The transformation can be found as:
1. Translate P0 to origin.
2. Align Vector V with K.
3. Rotate object about Z axis by angle .
4. Realign vector V back.
5. Retranslate P0 back.

November 29, 2024 Computer Graphics 83


Exercise 5
If P is the object point the sequence of transformations is:
1. Translate P0 to origin  P1 = T-P0(P)
2. Align Vector V with K.  P2 = AV,K(P1)
3. Rotate object about Z axis by angle .  P3 = R,K(P2)
4. Realign vector V back.  P4 = A-1V,K(P3)
5. Retranslate P0 back.  P5 = T-1-P0(P4)

Thus P5 = T-1-P0(P4)
= T-1-P0.A-1V,K(P3)
= T-1-P0.A-1V,K. R,K(P2)
= T-1-P0.A-1V,K. R,K. AV,K(P1)
= T-1-P0.A-1V,K. R,K. AV,K. T-P0(P)

Thus we form the matrix to be R,L= T-1-P A-1V,K R,K AV,KT-P


0 0
November 29, 2024 Computer Graphics 84
Exercise 5

November 29, 2024 Computer Graphics 85


Exercise 6
The pyramid is defined by A(0,0,0), B(1,0,0), C(0,1,0) and D(0,0,1) is
rotated by 450 about line L in the direction of V = J+K passing
through P(0,1,0). Find the coordinates of rotated figure.

 2 1 1 1   1 1 2 
    0 1 
 2 2 2 2   2 2 
 1 2 2 2 2 2 2
 2  2 2 4 2
1
2 2
R450 , L
 1
4 4 4   A' B' C ' D'  4 4 2 
2 2 2 2 2 2  2 2
  2 4 2 
 2 4 4 4   0 
 0 0 0 1   4 4 2 
 1 1 1 1 

November 29, 2024 Computer Graphics 86


Exercise 7
Find the transformation for mirror reflection with respect to
given plane specified by normal vector N and reference point
R0. z
The transformation can be found as:
N
1. Translate R0 to origin.
2. Align Vector N with K.
3. Reflect about XY plane.
R0 y
4. Realign vector N back.
5. Retranslate R0 back.
x

November 29, 2024 Computer Graphics 87


Exercise 7
If P is the object point the sequence of transformations is:
1. Translate R0 to origin  P1 = T-R0(P)
2. Align Vector N with K.  P2 = AN,K(P1)
3. Reflect object about XY plane.  P3 = Mxy(P2)
4. Realign vector N back.  P4 = A-1N,K(P3)
5. Retranslate R0 back.  P5 = T-1-R0(P4)

Thus P5 = T-1-R0(P4)
= T-1-R0.A-1N,K(P3)
= T-1-R0.A-1N,K. MXY(P2)
= T-1-R0.A-1N,K. MXY. AN,K(P1)
= T-1-R0.A-1N,K. MXY. AN,K. T-R0(P)

Thus we form the matrix to be MN,R0= T-1-R A-1N,K MXY AN,KT-R


0 0
November 29, 2024 Computer Graphics 88
Exercise 8
Find the mirror reflection of the Pyramid with respect to plane
passing through origin and having a normal vector N: I+J+K.

 1 2 2 
   0
3 3 3
 2 1 2 
  0
M N ,P0  3 3 3 
 2 2 1
  0
3 3 3
 0 0 0 1

November 29, 2024 Computer Graphics 89


Any Question !

You might also like