SlideShare a Scribd company logo
1 of 18
Three Dimensional Graphics
The three-dimensional transformations are extensions of two-
dimensional transformation. In 2D two coordinates are used, i.e.,
x and y whereas in 3D three co-ordinates x, y, and z are used.
For three dimensional images and objects, three-dimensional
transformations are needed. These are translations, scaling, and
rotation. These are also called as basic transformations are
represented using matrix. More complex transformations are
handled using matrix in 3D.
3D Geometry
Three dimension system has three axis x, y, z. The orientation
of a 3D coordinate system is of two types. Right-handed system
and left-handed system.
Using right-handed system co-ordinates of corners A, B, C, D
of the cube
Point A x, y, z
Point B x, y, 0
Point C 0, y, 0
Point D 0, y, z
Translation
 It is the movement of an object from one position to another position. Translation
is done using translation vectors. There are three vectors in 3D instead of two.
These vectors are in x, y, and z directions.
 Matrix representation of point translation.
 Point shown in fig is (x, y, z). It become (x1,y1,z1) after translation. Tx Ty Tz are
translation vector
Example:-
A point has coordinates in the x, y, z direction i.e., (5, 6, 7). The translation is
done in the x-direction by 3 coordinate and y direction. Three coordinates and in
the z- direction by two coordinates. Shift the object. Find coordinates of the new
position.
Solution: Co-ordinate of the point are (5, 6, 7)
Translation vector in x direction = 3
Translation vector in y direction = 3
Translation vector in z direction = 2
Translation matrix is
Multiply co-ordinates of point with translation matrix
x becomes x1=8
y becomes y1=9
z becomes z1=9
Scaling
Scaling is used to change the size of an object. The size can be increased or decreased. The
scaling three factors are required Sx Sy and Sz.
Sx=Scaling factor in x- direction
Sy=Scaling factor in y-direction
Sz=Scaling factor in z-direction
Matrix for Scaling-
Example:-
Given a 3D object with coordinate points A(0, 3, 3), B(3, 3, 6). Apply the scaling
parameter 2 towards X axis, 3 towards Y axis and 3 towards Z axis and obtain the
new coordinates of the object.
Solution :- Given-
Old coordinates of the object = A (0, 3, 3), B(3, 3, 6).
Scaling factor along X axis = 2
Scaling factor along Y axis = 3
Scaling factor along Z axis = 3
For Coordinates A(0, 3, 3)
Let the new coordinates of A after scaling = (Xnew, Ynew, Znew).
Xnew = Xold x Sx = 0 x 2 = 0
Ynew = Yold x Sy = 3 x 3 = 9
Znew = Zold x Sz = 3 x 3 = 9
Thus, New coordinates of corner A after scaling = (0, 9, 9).
For Coordinates B(3, 3, 6)
Let the new coordinates of B after scaling = (Xnew, Ynew, Znew).
Xnew = Xold x Sx = 3 x 2 = 6
Ynew = Yold x Sy = 3 x 3 = 9
Znew = Zold x Sz = 6 x 3 = 18
Thus, New coordinates of corner B after scaling = (6, 9, 18).
Rotation
It is moving of an object about an angle. Movement can be anticlockwise or clockwise. 3D
rotation is complex as compared to the 2D rotation. For 2D we describe the angle of
rotation, but for a 3D angle of rotation and axis of rotation are required. The axis can be
either x or y or z.
Matrix for representing three-dimensional rotations about the Z axis
Matrix for representing three-dimensional rotations about the X axis
Matrix for representing three-dimensional rotations about the Y axis
Example:-
Given a homogeneous point (1, 2, 3). Apply rotation 90 degree towards X, Y and Z axis and find
out the new coordinate points.
Solution :- Old coordinates = (Xold, Yold, Zold) = (1, 2, 3) Rotation angle = θ = 90º
For X-Axis Rotation-
Xnew = Xold = 1
Ynew = Yold x cosθ – Zold x sinθ = 2 x cos90° – 3 x sin90° = 2 x 0 – 3 x 1 = -3
Znew = Yold x sinθ + Zold x cosθ = 2 x sin90° + 3 x cos90° = 2 x 1 + 3 x 0 = 2
Thus, New coordinates after rotation = (1, -3, 2).0
For Y-Axis Rotation-
Xnew = Zold x sinθ + Xold x cosθ = 3 x sin90° + 1 x cos90° = 3 x 1 + 1 x 0 = 3
Ynew = Yold = 2
Znew = Yold x cosθ – Xold x sinθ = 2 x cos90° – 1 x sin90° = 2 x 0 – 1 x 1 = -1
Thus, New coordinates after rotation = (3, 2, -1).
For Z-Axis Rotation-
Xnew = Xold x cosθ – Yold x sinθ = 1 x cos90° – 2 x sin90° = 1 x 0 – 2 x 1 = -2
Ynew = Xold x sinθ + Yold x cosθ = 1 x sin90° + 2 x cos90° = 1 x 1 + 2 x 0 = 1
Znew = Zold = 3
Thus, New coordinates after rotation = (-2, 1, 3).
Reflection
It is also called a mirror image of an object. For this reflection axis and
reflection of plane is selected. Three-dimensional reflections are similar to
two dimensions. Reflection is 180° about the given axis. For reflection,
plane is selected (xy,xz or yz). Following matrices show reflection respect to
all these three planes
Reflection relative to XY plane
Matrix For XYCoordinates :-
Reflection relative to YZ plane
Reflection relative to XZ plane
Example:-
Given a 3D triangle with coordinate points A(3, 4, 1), B(6, 4, 2), C(5, 6, 3). Apply the
reflection on the XY plane and find out the new coordinates of the object.
Solution- Given:-Old corner coordinates of the triangle = A (3, 4, 1), B(6, 4, 2), C(5, 6,
3)
Reflection has to be taken on the XY plane
For Coordinates A(3, 4, 1)
Let the new coordintes of corner A after reflection = (Xnew, Ynew, Znew).
Xnew = Xold = 3
Ynew = Yold = 4
Znew = -Zold = -1
Thus, New coordinates of corner A after reflection = (3, 4, -1)
For Coordinates B(6, 4, 2)
Let the new coordinate of corner B after reflection = (Xnew, Ynew, Znew).
Xnew = Xold = 6
Ynew = Yold = 4
Znew = -Zold = -2
Thus, New coordinates of corner B after reflection = (6, 4, -2).
For Coordinates C(5, 6, 3)
Let the new coordinates of corner C after reflection = (Xnew, Ynew, Znew).
Xnew = Xold = 5
Ynew = Yold = 6
Znew = -Zold = -3
Thus, New coordinates of corner C after reflection = (5, 6, -3).
Thus, New coordinates of the triangle after reflection = A (3, 4, -1), B(6, 4, -2), C(5, 6, -3).
Shearing
It is change in the shape of the object. It is also called as deformation. Change can
be in the x -direction or y -direction or both directions in case of 2D. If shear occurs
in both directions, the object will be distorted. But in 3D shear can occur in three
directions
Shearing in X Axis-
Shearing in X axis is achieved by using the following shearing equations-
Xnew = Xold
Ynew = Yold + Shy x Xold
Znew = Zold + Shz x Xold
Shearing in Y Axis-
Shearing in Y axis is achieved by using the following shearing equations-
Xnew = Xold + Shx x Yold
Ynew = Yold
Znew = Zold + Shz x Yold
Shearing in Z Axis-
Shearing in Z axis is achieved by using the following shearing equations-
Xnew = Xold + Shx x Zold
Ynew = Yold + Shy x Zold
Znew = Zold
Example:-
Given a 3D triangle with points (0, 0, 0), (1, 1, 2) and (1, 1, 3). Apply shear
parameter 2 on X axis, 2 on Y axis and 3 on Z axis and find out the new
coordinates of the object
Solution-
Old corner coordinates of the triangle = A (0, 0, 0), B(1, 1, 2), C(1, 1, 3)
Shearing parameter towards X direction (Shx) = 2
Shearing parameter towards Y direction (Shy) = 2
Shearing parameter towards Y direction (Shz) = 3
Shearing in X Axis-
Coordinates A(0, 0, 0)
Let the new coordinates of corner A after shearing = (Xnew, Ynew, Znew).
Applying the shearing equations, we have-
Xnew = Xold = 0
Ynew = Yold + Shy x Xold = 0 + 2 x 0 = 0
Znew = Zold + Shz x Xold = 0 + 3 x 0 = 0
Thus, New coordinates of corner A after shearing = (0, 0, 0).
For Coordinates B(1, 1, 2)
Let the new coordinates of corner B after shearing = (Xnew, Ynew, Znew).
Applying the shearing equations, we have-
Xnew = Xold = 1
Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3
Znew = Zold + Shz x Xold = 2 + 3 x 1 = 5
Thus, New coordinates of corner B after shearing = (1, 3, 5).
For Coordinates C(1, 1, 3)
Let the new coordinates of corner C after shearing = (Xnew, Ynew, Znew).
Applying the shearing equations, we have-
Xnew = Xold = 1
Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3
Znew = Zold + Shz x Xold = 3 + 3 x 1 = 6
Thus, New coordinates of corner C after shearing = (1, 3, 6).
Thus, New coordinates of the triangle after shearing in X axis = A (0, 0, 0), B(1,
3, 5), C(1, 3, 6).
3D computer Graphic PPT.pptx in computer graphics

More Related Content

Similar to 3D computer Graphic PPT.pptx in computer graphics

2 d transformation
2 d transformation2 d transformation
2 d transformationAnkit Garg
 
Computer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3dComputer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3d2013901097
 
2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer GraphicsSusmita
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transformPatel Punit
 
Geometry unit 9.3
Geometry unit 9.3Geometry unit 9.3
Geometry unit 9.3Mark Ryder
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphicssabbirantor
 
Capitulo 1, 7ma edición
Capitulo 1, 7ma ediciónCapitulo 1, 7ma edición
Capitulo 1, 7ma ediciónSohar Carr
 
Three dimensional transformations
Three dimensional transformationsThree dimensional transformations
Three dimensional transformationsNareek
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics University of Potsdam
 
3 d transformation
3 d transformation3 d transformation
3 d transformationPooja Dixit
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 dxyz120
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Xad Kuain
 
Geometry unit 9.5
Geometry unit 9.5Geometry unit 9.5
Geometry unit 9.5Mark Ryder
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics FundamentalsMuhammed Afsal Villan
 

Similar to 3D computer Graphic PPT.pptx in computer graphics (20)

2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Computer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3dComputer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3d
 
Computer Graphics - transformations in 3d
Computer Graphics - transformations in 3dComputer Graphics - transformations in 3d
Computer Graphics - transformations in 3d
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
Geometry unit 9.3
Geometry unit 9.3Geometry unit 9.3
Geometry unit 9.3
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
Geometry Transformation
Geometry TransformationGeometry Transformation
Geometry Transformation
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
 
Capitulo 1, 7ma edición
Capitulo 1, 7ma ediciónCapitulo 1, 7ma edición
Capitulo 1, 7ma edición
 
Three dimensional transformations
Three dimensional transformationsThree dimensional transformations
Three dimensional transformations
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics
 
3D Transformation
3D Transformation 3D Transformation
3D Transformation
 
3 d transformation
3 d transformation3 d transformation
3 d transformation
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra
 
Geometry unit 9.5
Geometry unit 9.5Geometry unit 9.5
Geometry unit 9.5
 
Presentation reflection
Presentation reflectionPresentation reflection
Presentation reflection
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

3D computer Graphic PPT.pptx in computer graphics

  • 1. Three Dimensional Graphics The three-dimensional transformations are extensions of two- dimensional transformation. In 2D two coordinates are used, i.e., x and y whereas in 3D three co-ordinates x, y, and z are used. For three dimensional images and objects, three-dimensional transformations are needed. These are translations, scaling, and rotation. These are also called as basic transformations are represented using matrix. More complex transformations are handled using matrix in 3D.
  • 2. 3D Geometry Three dimension system has three axis x, y, z. The orientation of a 3D coordinate system is of two types. Right-handed system and left-handed system. Using right-handed system co-ordinates of corners A, B, C, D of the cube Point A x, y, z Point B x, y, 0 Point C 0, y, 0 Point D 0, y, z
  • 3. Translation  It is the movement of an object from one position to another position. Translation is done using translation vectors. There are three vectors in 3D instead of two. These vectors are in x, y, and z directions.  Matrix representation of point translation.  Point shown in fig is (x, y, z). It become (x1,y1,z1) after translation. Tx Ty Tz are translation vector
  • 4. Example:- A point has coordinates in the x, y, z direction i.e., (5, 6, 7). The translation is done in the x-direction by 3 coordinate and y direction. Three coordinates and in the z- direction by two coordinates. Shift the object. Find coordinates of the new position. Solution: Co-ordinate of the point are (5, 6, 7) Translation vector in x direction = 3 Translation vector in y direction = 3 Translation vector in z direction = 2 Translation matrix is Multiply co-ordinates of point with translation matrix x becomes x1=8 y becomes y1=9 z becomes z1=9
  • 5. Scaling Scaling is used to change the size of an object. The size can be increased or decreased. The scaling three factors are required Sx Sy and Sz. Sx=Scaling factor in x- direction Sy=Scaling factor in y-direction Sz=Scaling factor in z-direction Matrix for Scaling-
  • 6. Example:- Given a 3D object with coordinate points A(0, 3, 3), B(3, 3, 6). Apply the scaling parameter 2 towards X axis, 3 towards Y axis and 3 towards Z axis and obtain the new coordinates of the object. Solution :- Given- Old coordinates of the object = A (0, 3, 3), B(3, 3, 6). Scaling factor along X axis = 2 Scaling factor along Y axis = 3 Scaling factor along Z axis = 3 For Coordinates A(0, 3, 3) Let the new coordinates of A after scaling = (Xnew, Ynew, Znew). Xnew = Xold x Sx = 0 x 2 = 0 Ynew = Yold x Sy = 3 x 3 = 9 Znew = Zold x Sz = 3 x 3 = 9 Thus, New coordinates of corner A after scaling = (0, 9, 9).
  • 7. For Coordinates B(3, 3, 6) Let the new coordinates of B after scaling = (Xnew, Ynew, Znew). Xnew = Xold x Sx = 3 x 2 = 6 Ynew = Yold x Sy = 3 x 3 = 9 Znew = Zold x Sz = 6 x 3 = 18 Thus, New coordinates of corner B after scaling = (6, 9, 18).
  • 8. Rotation It is moving of an object about an angle. Movement can be anticlockwise or clockwise. 3D rotation is complex as compared to the 2D rotation. For 2D we describe the angle of rotation, but for a 3D angle of rotation and axis of rotation are required. The axis can be either x or y or z.
  • 9. Matrix for representing three-dimensional rotations about the Z axis Matrix for representing three-dimensional rotations about the X axis Matrix for representing three-dimensional rotations about the Y axis
  • 10. Example:- Given a homogeneous point (1, 2, 3). Apply rotation 90 degree towards X, Y and Z axis and find out the new coordinate points. Solution :- Old coordinates = (Xold, Yold, Zold) = (1, 2, 3) Rotation angle = θ = 90º For X-Axis Rotation- Xnew = Xold = 1 Ynew = Yold x cosθ – Zold x sinθ = 2 x cos90° – 3 x sin90° = 2 x 0 – 3 x 1 = -3 Znew = Yold x sinθ + Zold x cosθ = 2 x sin90° + 3 x cos90° = 2 x 1 + 3 x 0 = 2 Thus, New coordinates after rotation = (1, -3, 2).0 For Y-Axis Rotation- Xnew = Zold x sinθ + Xold x cosθ = 3 x sin90° + 1 x cos90° = 3 x 1 + 1 x 0 = 3 Ynew = Yold = 2 Znew = Yold x cosθ – Xold x sinθ = 2 x cos90° – 1 x sin90° = 2 x 0 – 1 x 1 = -1 Thus, New coordinates after rotation = (3, 2, -1). For Z-Axis Rotation- Xnew = Xold x cosθ – Yold x sinθ = 1 x cos90° – 2 x sin90° = 1 x 0 – 2 x 1 = -2 Ynew = Xold x sinθ + Yold x cosθ = 1 x sin90° + 2 x cos90° = 1 x 1 + 2 x 0 = 1 Znew = Zold = 3 Thus, New coordinates after rotation = (-2, 1, 3).
  • 11. Reflection It is also called a mirror image of an object. For this reflection axis and reflection of plane is selected. Three-dimensional reflections are similar to two dimensions. Reflection is 180° about the given axis. For reflection, plane is selected (xy,xz or yz). Following matrices show reflection respect to all these three planes Reflection relative to XY plane
  • 12. Matrix For XYCoordinates :- Reflection relative to YZ plane Reflection relative to XZ plane Example:- Given a 3D triangle with coordinate points A(3, 4, 1), B(6, 4, 2), C(5, 6, 3). Apply the reflection on the XY plane and find out the new coordinates of the object. Solution- Given:-Old corner coordinates of the triangle = A (3, 4, 1), B(6, 4, 2), C(5, 6, 3) Reflection has to be taken on the XY plane
  • 13. For Coordinates A(3, 4, 1) Let the new coordintes of corner A after reflection = (Xnew, Ynew, Znew). Xnew = Xold = 3 Ynew = Yold = 4 Znew = -Zold = -1 Thus, New coordinates of corner A after reflection = (3, 4, -1) For Coordinates B(6, 4, 2) Let the new coordinate of corner B after reflection = (Xnew, Ynew, Znew). Xnew = Xold = 6 Ynew = Yold = 4 Znew = -Zold = -2 Thus, New coordinates of corner B after reflection = (6, 4, -2). For Coordinates C(5, 6, 3) Let the new coordinates of corner C after reflection = (Xnew, Ynew, Znew). Xnew = Xold = 5 Ynew = Yold = 6 Znew = -Zold = -3 Thus, New coordinates of corner C after reflection = (5, 6, -3). Thus, New coordinates of the triangle after reflection = A (3, 4, -1), B(6, 4, -2), C(5, 6, -3).
  • 14. Shearing It is change in the shape of the object. It is also called as deformation. Change can be in the x -direction or y -direction or both directions in case of 2D. If shear occurs in both directions, the object will be distorted. But in 3D shear can occur in three directions Shearing in X Axis- Shearing in X axis is achieved by using the following shearing equations- Xnew = Xold Ynew = Yold + Shy x Xold Znew = Zold + Shz x Xold Shearing in Y Axis- Shearing in Y axis is achieved by using the following shearing equations- Xnew = Xold + Shx x Yold Ynew = Yold Znew = Zold + Shz x Yold
  • 15. Shearing in Z Axis- Shearing in Z axis is achieved by using the following shearing equations- Xnew = Xold + Shx x Zold Ynew = Yold + Shy x Zold Znew = Zold Example:- Given a 3D triangle with points (0, 0, 0), (1, 1, 2) and (1, 1, 3). Apply shear parameter 2 on X axis, 2 on Y axis and 3 on Z axis and find out the new coordinates of the object Solution- Old corner coordinates of the triangle = A (0, 0, 0), B(1, 1, 2), C(1, 1, 3) Shearing parameter towards X direction (Shx) = 2 Shearing parameter towards Y direction (Shy) = 2 Shearing parameter towards Y direction (Shz) = 3 Shearing in X Axis-
  • 16. Coordinates A(0, 0, 0) Let the new coordinates of corner A after shearing = (Xnew, Ynew, Znew). Applying the shearing equations, we have- Xnew = Xold = 0 Ynew = Yold + Shy x Xold = 0 + 2 x 0 = 0 Znew = Zold + Shz x Xold = 0 + 3 x 0 = 0 Thus, New coordinates of corner A after shearing = (0, 0, 0). For Coordinates B(1, 1, 2) Let the new coordinates of corner B after shearing = (Xnew, Ynew, Znew). Applying the shearing equations, we have- Xnew = Xold = 1 Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3 Znew = Zold + Shz x Xold = 2 + 3 x 1 = 5 Thus, New coordinates of corner B after shearing = (1, 3, 5). For Coordinates C(1, 1, 3)
  • 17. Let the new coordinates of corner C after shearing = (Xnew, Ynew, Znew). Applying the shearing equations, we have- Xnew = Xold = 1 Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3 Znew = Zold + Shz x Xold = 3 + 3 x 1 = 6 Thus, New coordinates of corner C after shearing = (1, 3, 6). Thus, New coordinates of the triangle after shearing in X axis = A (0, 0, 0), B(1, 3, 5), C(1, 3, 6).