Docsity

3D Transformation- Rotation, Lecture notes of Computer Graphics

Partial preview of the text

Download 3D Transformation- Rotation and more Lecture notes Computer Graphics in PDF only on Docsity!

3D TRANSFORMATION

(Rotation)

By:

Arvind Kumar

Assistant Professor

(Vidya College of Engineering)

3D Rotation

3D

About the Coordinate-Axis

  • X-axis rotation
  • Y-axis rotation
  • Z-axis rotation

Composite 3D Rotations

  • Rotation about an axis that is parallel to one

of the coordinate axis

  • Rotation about an arbitrary axis

3D

3D Rotation Coordinate axis

3D

About Y-Axis

3D

z

y

x

sin 0 cos 0
cos 0 sin 0
z
y
x
z
y
x

 

 

3D Rotation Coordinate axis

3D

About Z-Axis

3D

z

y

x

sin cos 0 0
cos sin 0 0
z
y
x
z
y
x

 

 

Rotation about an arbitrary Axis

3D

Steps to be Follows

1. Translate (x 1 , y 1 , z 1 ) to the **origin

  1. Rotate (x’ 2 , y’ 2 , z’ 2 ) on to the z**

axis

3. Rotate the object around the z-

axis

4. Rotate back the axis to the

original orientation

5. Translate the rotation axis to

the original position

Rxy-^1

T-^1

Rxy

T

R ( ) T R x ( ) R (^) y ( ) R (^) z ( ) R (^) y ( ) R (^) x (  ) T

− 1 − 1 − 1

Rz

(x 2 ,y 2 ,z 2 )

(x 1 ,y 1 ,z 1 )

x

z

y

Rotation about an arbitrary Axis

3D

❖ Step 1. Translation

−

−

−

=

0 0 0 1

0 0 1

0 1 0

1 0 0

1

1

1

tz

ty

tx

T

(x 2 ,y 2 ,z 2 )

(x 1 ,y 1 ,z 1 )

x

z

y

Rotation about an arbitrary Axis

3 D

  • Step 3. Rotation about y axis

2 2

2 2 2 2 2 2

sin , cos

d b c

l a b c a d

l

d

l

a

= +

= + + = +

 =  =

( )

 −

=

 −

=

0 0 0 1

/ 0 / 0

0 1 0 0

/ 0 / 0

0 0 0 1

sin 0 cos 0

0 1 0 0

cos 0 sin 0

a l d l

d l a l

y  

 

R

(a,b,c)

l

d x

y

z

(a,0,d)

Rotation about an arbitrary Axis

3D

❖ Step 4. Rotation about z axis

( )

 −

=

0 0 0 1

0 0 1 0

sin cos 0 0

cos sin 0 0

 

 

R z

l

y

x

z

Numerical

3D

Q1. Find the new coordinates of a unit cube 90 ᵒ rotated about

an axis defined by its endpoints A(2,1,0) and B(3,3,1).

Solution:

3D

Step1. Translate point A to the origin

x

z

y

B’(1,2,1)

−

−

=

0 0 0 1

0 0 1 0

0 1 0 1

1 0 0 2

T

A’(0,0,0)

A’(2,1,0)

B’(3,3,1)

Solution:

3D

Step3. Rotate axis A’B’ about the y axis, until it

coincides with the z axis.

( )

 −

=

0 0 0 1

0 6

30 0 6

6

0 1 0 0

0 6

6 0 6

30

R y

6

30

6

5 cos

6

6

6

1 sin

= =

= =

x

z

y

l

B”(1,0,5)

A’(0,0,5 )

Solution:

3D

Step4. Rotate the cube 90 ° about the z axis

( )

 −

 =

0 0 0 1

0 0 1 0

1 0 0 0

0 1 0 0

R z 90

R ( ) T R ( ) R ( ) R ( ) R ( ) R (  ) T

x y z y x

− − −

1 1 1

Finally, Matrix about the arbitrary axis

Solution:

3D

Step5. Multiplying R( θ ) by the point matrix of the

original cube

P  = R ( )   P

−

− − − − − −

−

−

−

 =

1 1 1 1 1 1 1 1

  1. 467 1. 301 0. 650 0. 817 0. 726 0. 560 0. 091 0. 076

  2. 558 0. 484 0. 258 0. 184 1. 225 1. 151 0. 409 0. 483

  3. 650 1. 667 1. 834 2. 816 2. 725 1. 742 1. 909 2. 891

1 1 1 1 1 1 1 1

1 0 0 1 1 0 0 1

1 1 1 1 0 0 0 0

0 0 1 1 0 0 1 1

0 0 0 1

  1. 650 0. 741 0. 167 0. 560

  2. 742 0. 667 0. 075 1. 151

  3. 166 0. 075 0. 983 1. 742

P