{"id":248,"date":"2018-07-21T04:24:34","date_gmt":"2018-07-21T04:24:34","guid":{"rendered":"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=248"},"modified":"2018-12-26T12:36:48","modified_gmt":"2018-12-26T12:36:48","slug":"3d-transformations","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/chapter\/3d-transformations\/","title":{"rendered":"3D Transformations"},"content":{"raw":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/yReIQWSnwys\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Objectives:<\/strong>\r\n<ul>\r\n \t<li>To Understand the conventions for object transformations in 3D<\/li>\r\n \t<li>To Understand basic transformations in 3D, Translation, Rotation, Scaling<\/li>\r\n \t<li>To understand other transformations like Reflection, Shear<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Discussion:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">3D Transformations are mere extensions of 2D transformations, on most of the occasions, except for a few. In fact, the objects in the real world are in 3D, so, 2D is only a special case of 3D. All of the graphics API\u2019s start with assumptions that, operations are performed in 3D, and by substituting 0 for the third coordinate (<em>z<\/em>), we get 2D.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Let\u2019s first understand some important conventions for applying 3D transformations on objects. A coordinate system in 3D world is made up of 3 coordinate axes <em>X<\/em>, <em>Y<\/em>, <em>Z<\/em> in mutually perpendicular directions.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-252 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-171.png\" alt=\"\" width=\"289\" height=\"242\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In a Right-Handed (RH) coordinate system as shown above, open the first 3 fingers of your right hand, orient them such that the thumb points at +ve <em>X<\/em>-direction (to the right side), Index finger points at the +ve <em>Y<\/em>-direction (upside), middle finger points at the +ve <em>Z<\/em>-direction (to\u00a0<span style=\"text-align: initial;font-size: 1em\">yourself). In such an alignment, it is always that we see the world along the \u2013ve <\/span><em style=\"text-align: initial;font-size: 1em\">Z<\/em><span style=\"text-align: initial;font-size: 1em\">-direction, as the +ve <\/span><em style=\"text-align: initial;font-size: 1em\">Z<\/em><span style=\"text-align: initial;font-size: 1em\">-direction is pointing towards self as shown in the figure below.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-253 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-172.png\" alt=\"\" width=\"188\" height=\"156\" \/>\r\n\r\n&nbsp;\r\n\r\nImage source: (http:\/\/what-when-how.com\/wp-content\/uploads\/2011\/08\/tmpD54_thumb.jpg)\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">If we use our left-hand for representing a 3D coordinate system, as similar to that of the RH coordinate system, we call that a Left-Handed (LH) coordinate system, as shown below, where the <em>Z<\/em>- direction is away from the self and points in the opposite direction, with X and Y directions still being the same as that of the RH coordinate system.<\/p>\r\n<img class=\"size-full wp-image-254 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-173.png\" alt=\"\" width=\"195\" height=\"144\" \/>\r\n\r\n&nbsp;\r\n\r\nImage source: (http:\/\/what-when-how.com\/wp-content\/uploads\/2011\/08\/tmpD55_thumb.jpg)\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">With RH being the convention, that we shall follow, it should be always remembered that we see the world along the \u2013ve <em>Z<\/em>-direction.<\/p>\r\n&nbsp;\r\n\r\n<strong>Basic Transformations in 3D:<\/strong>\r\n\r\n&nbsp;\r\n\r\nTranslation in 3D:\r\n\r\n<img class=\"size-full wp-image-255 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174.png\" alt=\"\" width=\"503\" height=\"181\" \/>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As similar to that of 2D Translation, 3D translation is represented using the following equations, with <em>t<\/em><em>x<\/em>, <em>t<\/em><em>y<\/em>, <em>t<\/em> <em>z<\/em> being the translational distances along the 3 coordinate axes respectively.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n<p style=\"text-align: center\"><em>\u00a0 \u00a0x<\/em>\u2019 =<em> x <\/em>+<em> t<\/em><em>x<\/em><\/p>\r\n<p style=\"text-align: center\"><em>y<\/em>\u2019 =<em> y <\/em>+<em> t<\/em><em>y<\/em><\/p>\r\n<p style=\"text-align: center\"><em>z<\/em>\u2019 =<em> z <\/em>+<em> t<\/em><em>z<\/em><\/p>\r\nThe corresponding matrix representation in homogeneous form is given by\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-256 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-175.png\" alt=\"\" width=\"219\" height=\"161\" \/>\r\n\r\nRotation in 3D:\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Rotation in 3D is complex, because, rotation is performed with respect to an axis of rotation (unlike 2D rotation which is about a pivot point) and the possible orientations of the objects and the axes about which the objects are rotated. It is also important to know the conventions for rotation for whether it is +ve or \u2013ve. Rotations about an axis in counter clock-wise direction, when viewed along \u2013ve direction of that axis are considered +ve.<\/p>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-257 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-176.png\" alt=\"\" width=\"213\" height=\"144\" \/>\r\n<p style=\"text-align: justify\">3D rotation can be classified as \u2018<em>coordinate-axes rotations<\/em>\u2019, which are rotations performed about the standard coordinate axes, and \u2018<em>General<\/em> 3<em>D rotations<\/em>\u2019, which are performed about any general direction in space. Observe that, rotations about any axis (assuming standard axes), does not alter the corresponding coordinate, but alters the other coordinates, i.e., if we perform rotation about <em>X<\/em>-axis, the <em>x<\/em>-coordinate remains same after rotation, but <em>y<\/em>, <em>z<\/em> get altered.<\/p>\r\n&nbsp;\r\n\r\n\u2022 Coordinate-Axes Rotations\r\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>X<\/em>-axis rotation (pitch)<\/p>\r\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>Y<\/em>-axis rotation (yaw)<\/p>\r\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>Z<\/em>-axis rotation (roll)<\/p>\r\n\u2022 General 3D Rotations\r\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 Rotation about an axis that is parallel to one of the coordinate axes<\/p>\r\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 Rotation about an arbitrary axis<\/p>\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Coordinate-Axes Rotations:<\/span>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As shown in the figure below, rotation about <em>X<\/em>-axis is called, the \u2018<em>pitch<\/em>\u2019, rotation about <em>Y<\/em>-axis is called \u2018<em>yaw<\/em>\u2019 and rotation about <em>Z<\/em>-axis is called \u2018<em>roll\u2019<\/em>.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-258 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177.png\" alt=\"\" width=\"319\" height=\"175\" \/>\r\n\r\n&nbsp;\r\n\r\nZ-axis rotation:\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-259 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178.png\" alt=\"\" width=\"311\" height=\"147\" \/>\r\n\r\n&nbsp;\r\n\r\nThe equations for +ve rotation about Z-axis are given below.\r\n\r\n&nbsp;\r\n<p style=\"text-align: center\"><em>x<\/em>\u2019 =<em> x cos<\/em><em>q<\/em> -<em> y sin<\/em><em>q<\/em><\/p>\r\n<p style=\"text-align: center\"><em>y<\/em>\u2019 =<em> x sin<\/em><em>q<\/em> +<em> y cos<\/em><em>q<\/em><\/p>\r\n<p style=\"text-align: center\"><em>z<\/em>\u2019 =<em> z<\/em><\/p>\r\n&nbsp;\r\n\r\nThe above equations can be represented in homogeneous matrix representation as below\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-260 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-179.png\" alt=\"\" width=\"266\" height=\"128\" \/>\r\n\r\n<strong><em>P<\/em><\/strong><strong>\u2019 =<em> R<\/em><\/strong><strong><em>z<\/em><\/strong><strong>(<em>\u03b8<\/em>).<em>P<\/em><\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The matrix <em>R<\/em><em>z<\/em>(<em>\u03b8<\/em>) represents rotation about <em>Z<\/em>-axis by an angle <em>\u03b8<\/em>. It can be observed that, <em>Z<\/em>-axis rotation in 3D is same as that of 2D rotation about origin, except for the additional<em> z<\/em>-coordinate in 3D rotation, which is not altered after rotation.<\/p>\r\n&nbsp;\r\n\r\nRotations about <em>X<\/em>, <em>Y<\/em> axes:\r\n\r\n&nbsp;\r\n\r\nFollow this thumb rule to write eqs. for rotations with respect to <em>X<\/em> and <em>Y<\/em> axes.\r\n\r\n&nbsp;\r\n<p style=\"text-align: center\"><strong><em>x-&gt;<\/em><\/strong><strong><em>y -&gt;<\/em><\/strong><strong><em>z -&gt;<\/em><\/strong><strong><em>x<\/em><\/strong><\/p>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify\"><strong><em>\u00a0<\/em><\/strong><span style=\"text-align: justify;font-size: 1em\">which says that, in the equations for <\/span><em style=\"text-align: justify;font-size: 1em\">Z<\/em><span style=\"text-align: justify;font-size: 1em\">-axis rotation, replace <\/span><em style=\"text-align: justify;font-size: 1em\">x<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">y<\/em><span style=\"text-align: justify;font-size: 1em\">, <\/span><em style=\"text-align: justify;font-size: 1em\">y<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">z<\/em><span style=\"text-align: justify;font-size: 1em\"> and <\/span><em style=\"text-align: justify;font-size: 1em\">z<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">x<\/em><span style=\"text-align: justify;font-size: 1em\">, we will get equations for rotations about <\/span><em style=\"text-align: justify;font-size: 1em\">X<\/em><span style=\"text-align: justify;font-size: 1em\">-axis and <\/span><em style=\"text-align: justify;font-size: 1em\">Y<\/em><span style=\"text-align: justify;font-size: 1em\">-axis after subsequent substitutions. Equations for rotation about <\/span><em style=\"text-align: justify;font-size: 1em\">X<\/em><span style=\"text-align: justify;font-size: 1em\">-axis can thus be obtained using the above thumb rule as<\/span><\/p>\r\n\r\n<div>\r\n<p style=\"text-align: center\"><em>x\u2019 = x<\/em><\/p>\r\n<p style=\"text-align: center\"><em>y\u2019 = y cos\u03b8 <\/em>\u2013<em> z sin\u03b8<\/em><\/p>\r\n<p style=\"text-align: center\"><em>z\u2019 = y sin\u03b8 <\/em>+<em> zcos\u03b8<\/em><\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-261 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180.png\" alt=\"\" width=\"326\" height=\"309\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Equations for rotation about <em>Y<\/em>-axis can similarly be obtained using the above thumb rule and by substituting in the equations for rotation about <em>X<\/em>-axis we get<\/p>\r\n&nbsp;\r\n<p style=\"text-align: center\"><em>x\u2019 = z sin\u03b8 <\/em>+<em> x cos\u03b8<\/em><\/p>\r\n<p style=\"text-align: center\"><em>y\u2019 = y<\/em><\/p>\r\n<p style=\"text-align: center\"><em>z\u2019 = z cos<\/em>\u03b8 \u2013<em> x sin\u03b8<\/em><\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-262 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-181.png\" alt=\"\" width=\"256\" height=\"132\" \/>\r\n\r\n<img class=\"size-full wp-image-263 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182.png\" alt=\"\" width=\"349\" height=\"178\" \/>\r\n\r\n<\/div>\r\n&nbsp;\r\n<div>\r\n\r\n<span style=\"text-decoration: underline\">3D Rotation about an axis that is parallel to one of the coordinate axes (say <em>X<\/em>-axis):<\/span>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">If we assume that the rotation axis is parallel to <em>X<\/em>-axis then we need to first translate the axis such that it coincides with <em>X<\/em>-axis, and then perform standard rotation about <em>X<\/em>-axis, followed by inverse translation as shown below.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-264 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183.png\" alt=\"\" width=\"662\" height=\"181\" \/>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-decoration: underline\">General 3D rotation about any axis randomly oriented in space:<\/span>\r\n<ul>\r\n \t<li style=\"text-align: justify\"><em>Translate <\/em>the axis so the rotation axis passes through the origin<\/li>\r\n \t<li style=\"text-align: justify\"><em>Rotate <\/em>the axis so that the axis coincides with one of the coordinate (<em>x<\/em>,<em> y<\/em>, or<em> z<\/em>) axes<\/li>\r\n \t<li style=\"text-align: justify\">Perform the specified <em>rotation<\/em> about the selected coordinate axis<\/li>\r\n \t<li style=\"text-align: justify\">Apply the <em>inverse rotations<\/em> to bring the coordinate axis back to its original orientation<\/li>\r\n \t<li style=\"text-align: justify\">Apply the <em>inverse translation<\/em> to bring the rotation axis back to its original spatial location<\/li>\r\n<\/ul>\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"size-full wp-image-265 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184.png\" alt=\"\" width=\"646\" height=\"265\" \/>\r\n\r\n<img class=\"size-full wp-image-266 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185.png\" alt=\"\" width=\"667\" height=\"265\" \/>\r\n\r\n<\/div>\r\n<div>\r\n\r\nThis complex rotation can be represented in notation form as\r\n\r\n<img class=\"size-full wp-image-267 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-186.png\" alt=\"\" width=\"229\" height=\"44\" \/>\r\n\r\n<strong>Scaling in 3D:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">It is same as that in 2D, except for the additional scaling factor <em>S<\/em><em>z<\/em> along the z-axis<\/p>\r\n\r\n<\/div>\r\n<img class=\"size-full wp-image-268 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187.png\" alt=\"\" width=\"392\" height=\"244\" \/>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Reflection in 3D:<\/strong>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Reflection in 3D involves a <em>plane of reflection<\/em> with respect to which objects are reflected (unlike 2D reflection which involves axis of reflection). We can consider the standard reflection planes the <em>XY<\/em> plane, whose equation is <em>Z<\/em>=0, the <em>YZ<\/em> plane whose equation is <em>X<\/em>=0 and the <em>XZ<\/em> plane, whose equation is <em>Y<\/em>=0. When we perform reflection with respect to a standard plane say the XY plane, the <em>x<\/em> and <em>y<\/em> coordinates remain the same and the <em>z<\/em>-coordinate gets flipped.<\/p>\r\n\r\n<\/div>\r\n<img class=\"size-full wp-image-269 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188.png\" alt=\"\" width=\"339\" height=\"233\" \/>\r\n\r\n&nbsp;\r\n\r\nThe above matrix can be represented in notation form as\r\n\r\n<img class=\"size-full wp-image-270 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-189.png\" alt=\"\" width=\"91\" height=\"20\" \/>\r\n<p style=\"text-align: justify\">Where <em>RF<\/em><em>z<\/em> is reflection with respect to <em>Z<\/em>=0 plane (<em>XY<\/em> plane). We can write similar equations for reflections with respect to other standard planes.<\/p>\r\n&nbsp;\r\n\r\n<strong>Shear in 3D:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Shear in 3D, produces shapes that are deformed, but unlike 2D shear, 3D shear affects planes, i.e., an object gets sheared along a shearing plane. Z-axis shear, represented as <em>SH<\/em><em>z<\/em> is given by<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-271 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-190.png\" alt=\"\" width=\"189\" height=\"128\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Parameters, <em>a<\/em> and <em>b<\/em> in the matrix shown above, can be assigned any real values. The effect of this transformation is to shear X and Y values by an amount proportional to the z-value i.e., to shear planes of constant <em>Z<\/em>.<\/p>\r\n&nbsp;\r\n\r\n<strong>Summary:<\/strong>\r\n<ul>\r\n \t<li>Learnt coordinate system conventions.<\/li>\r\n \t<li style=\"text-align: justify\">Learnt basic 3D Transformations including Translation, Rotation and Scaling, Rotation about an arbitrary axis.<\/li>\r\n \t<li>Other transformations including Reflection, shear.<\/li>\r\n<\/ul>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on 3D Transformations<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/yReIQWSnwys\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n\r\n<img class=\"size-full wp-image-272 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191.png\" alt=\"\" width=\"646\" height=\"330\" \/>","rendered":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/yReIQWSnwys\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Objectives:<\/strong><\/p>\n<ul>\n<li>To Understand the conventions for object transformations in 3D<\/li>\n<li>To Understand basic transformations in 3D, Translation, Rotation, Scaling<\/li>\n<li>To understand other transformations like Reflection, Shear<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Discussion:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">3D Transformations are mere extensions of 2D transformations, on most of the occasions, except for a few. In fact, the objects in the real world are in 3D, so, 2D is only a special case of 3D. All of the graphics API\u2019s start with assumptions that, operations are performed in 3D, and by substituting 0 for the third coordinate (<em>z<\/em>), we get 2D.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Let\u2019s first understand some important conventions for applying 3D transformations on objects. A coordinate system in 3D world is made up of 3 coordinate axes <em>X<\/em>, <em>Y<\/em>, <em>Z<\/em> in mutually perpendicular directions.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-252 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-171.png\" alt=\"\" width=\"289\" height=\"242\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-171.png 289w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-171-65x54.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-171-225x188.png 225w\" sizes=\"auto, (max-width: 289px) 100vw, 289px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In a Right-Handed (RH) coordinate system as shown above, open the first 3 fingers of your right hand, orient them such that the thumb points at +ve <em>X<\/em>-direction (to the right side), Index finger points at the +ve <em>Y<\/em>-direction (upside), middle finger points at the +ve <em>Z<\/em>-direction (to\u00a0<span style=\"text-align: initial;font-size: 1em\">yourself). In such an alignment, it is always that we see the world along the \u2013ve <\/span><em style=\"text-align: initial;font-size: 1em\">Z<\/em><span style=\"text-align: initial;font-size: 1em\">-direction, as the +ve <\/span><em style=\"text-align: initial;font-size: 1em\">Z<\/em><span style=\"text-align: initial;font-size: 1em\">-direction is pointing towards self as shown in the figure below.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-253 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-172.png\" alt=\"\" width=\"188\" height=\"156\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-172.png 188w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-172-65x54.png 65w\" sizes=\"auto, (max-width: 188px) 100vw, 188px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Image source: (http:\/\/what-when-how.com\/wp-content\/uploads\/2011\/08\/tmpD54_thumb.jpg)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">If we use our left-hand for representing a 3D coordinate system, as similar to that of the RH coordinate system, we call that a Left-Handed (LH) coordinate system, as shown below, where the <em>Z<\/em>&#8211; direction is away from the self and points in the opposite direction, with X and Y directions still being the same as that of the RH coordinate system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-254 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-173.png\" alt=\"\" width=\"195\" height=\"144\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-173.png 195w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-173-65x48.png 65w\" sizes=\"auto, (max-width: 195px) 100vw, 195px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Image source: (http:\/\/what-when-how.com\/wp-content\/uploads\/2011\/08\/tmpD55_thumb.jpg)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">With RH being the convention, that we shall follow, it should be always remembered that we see the world along the \u2013ve <em>Z<\/em>-direction.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Basic Transformations in 3D:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Translation in 3D:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-255 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174.png\" alt=\"\" width=\"503\" height=\"181\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174.png 503w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174-300x108.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174-65x23.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174-225x81.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-174-350x126.png 350w\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As similar to that of 2D Translation, 3D translation is represented using the following equations, with <em>t<\/em><em>x<\/em>, <em>t<\/em><em>y<\/em>, <em>t<\/em> <em>z<\/em> being the translational distances along the 3 coordinate axes respectively.<\/p>\n<\/div>\n<div>\n<p style=\"text-align: center\"><em>\u00a0 \u00a0x<\/em>\u2019 =<em> x <\/em>+<em> t<\/em><em>x<\/em><\/p>\n<p style=\"text-align: center\"><em>y<\/em>\u2019 =<em> y <\/em>+<em> t<\/em><em>y<\/em><\/p>\n<p style=\"text-align: center\"><em>z<\/em>\u2019 =<em> z <\/em>+<em> t<\/em><em>z<\/em><\/p>\n<p>The corresponding matrix representation in homogeneous form is given by<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-256 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-175.png\" alt=\"\" width=\"219\" height=\"161\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-175.png 219w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-175-65x48.png 65w\" sizes=\"auto, (max-width: 219px) 100vw, 219px\" \/><\/p>\n<p>Rotation in 3D:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Rotation in 3D is complex, because, rotation is performed with respect to an axis of rotation (unlike 2D rotation which is about a pivot point) and the possible orientations of the objects and the axes about which the objects are rotated. It is also important to know the conventions for rotation for whether it is +ve or \u2013ve. Rotations about an axis in counter clock-wise direction, when viewed along \u2013ve direction of that axis are considered +ve.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-257 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-176.png\" alt=\"\" width=\"213\" height=\"144\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-176.png 213w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-176-65x44.png 65w\" sizes=\"auto, (max-width: 213px) 100vw, 213px\" \/><\/p>\n<p style=\"text-align: justify\">3D rotation can be classified as \u2018<em>coordinate-axes rotations<\/em>\u2019, which are rotations performed about the standard coordinate axes, and \u2018<em>General<\/em> 3<em>D rotations<\/em>\u2019, which are performed about any general direction in space. Observe that, rotations about any axis (assuming standard axes), does not alter the corresponding coordinate, but alters the other coordinates, i.e., if we perform rotation about <em>X<\/em>-axis, the <em>x<\/em>-coordinate remains same after rotation, but <em>y<\/em>, <em>z<\/em> get altered.<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022 Coordinate-Axes Rotations<\/p>\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>X<\/em>-axis rotation (pitch)<\/p>\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>Y<\/em>-axis rotation (yaw)<\/p>\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 <em>Z<\/em>-axis rotation (roll)<\/p>\n<p>\u2022 General 3D Rotations<\/p>\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 Rotation about an axis that is parallel to one of the coordinate axes<\/p>\n<p style=\"padding-left: 60px\">\u2013\u00a0\u00a0 Rotation about an arbitrary axis<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Coordinate-Axes Rotations:<\/span><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As shown in the figure below, rotation about <em>X<\/em>-axis is called, the \u2018<em>pitch<\/em>\u2019, rotation about <em>Y<\/em>-axis is called \u2018<em>yaw<\/em>\u2019 and rotation about <em>Z<\/em>-axis is called \u2018<em>roll\u2019<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-258 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177.png\" alt=\"\" width=\"319\" height=\"175\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177.png 319w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177-300x165.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177-65x36.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-177-225x123.png 225w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Z-axis rotation:<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-259 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178.png\" alt=\"\" width=\"311\" height=\"147\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178.png 311w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178-300x142.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178-65x31.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-178-225x106.png 225w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The equations for +ve rotation about Z-axis are given below.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><em>x<\/em>\u2019 =<em> x cos<\/em><em>q<\/em> &#8211;<em> y sin<\/em><em>q<\/em><\/p>\n<p style=\"text-align: center\"><em>y<\/em>\u2019 =<em> x sin<\/em><em>q<\/em> +<em> y cos<\/em><em>q<\/em><\/p>\n<p style=\"text-align: center\"><em>z<\/em>\u2019 =<em> z<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The above equations can be represented in homogeneous matrix representation as below<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-260 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-179.png\" alt=\"\" width=\"266\" height=\"128\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-179.png 266w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-179-65x31.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-179-225x108.png 225w\" sizes=\"auto, (max-width: 266px) 100vw, 266px\" \/><\/p>\n<p><strong><em>P<\/em><\/strong><strong>\u2019 =<em> R<\/em><\/strong><strong><em>z<\/em><\/strong><strong>(<em>\u03b8<\/em>).<em>P<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The matrix <em>R<\/em><em>z<\/em>(<em>\u03b8<\/em>) represents rotation about <em>Z<\/em>-axis by an angle <em>\u03b8<\/em>. It can be observed that, <em>Z<\/em>-axis rotation in 3D is same as that of 2D rotation about origin, except for the additional<em> z<\/em>-coordinate in 3D rotation, which is not altered after rotation.<\/p>\n<p>&nbsp;<\/p>\n<p>Rotations about <em>X<\/em>, <em>Y<\/em> axes:<\/p>\n<p>&nbsp;<\/p>\n<p>Follow this thumb rule to write eqs. for rotations with respect to <em>X<\/em> and <em>Y<\/em> axes.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><strong><em>x-&gt;<\/em><\/strong><strong><em>y -&gt;<\/em><\/strong><strong><em>z -&gt;<\/em><\/strong><strong><em>x<\/em><\/strong><\/p>\n<\/div>\n<p style=\"text-align: justify\"><strong><em>\u00a0<\/em><\/strong><span style=\"text-align: justify;font-size: 1em\">which says that, in the equations for <\/span><em style=\"text-align: justify;font-size: 1em\">Z<\/em><span style=\"text-align: justify;font-size: 1em\">-axis rotation, replace <\/span><em style=\"text-align: justify;font-size: 1em\">x<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">y<\/em><span style=\"text-align: justify;font-size: 1em\">, <\/span><em style=\"text-align: justify;font-size: 1em\">y<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">z<\/em><span style=\"text-align: justify;font-size: 1em\"> and <\/span><em style=\"text-align: justify;font-size: 1em\">z<\/em><span style=\"text-align: justify;font-size: 1em\"> with <\/span><em style=\"text-align: justify;font-size: 1em\">x<\/em><span style=\"text-align: justify;font-size: 1em\">, we will get equations for rotations about <\/span><em style=\"text-align: justify;font-size: 1em\">X<\/em><span style=\"text-align: justify;font-size: 1em\">-axis and <\/span><em style=\"text-align: justify;font-size: 1em\">Y<\/em><span style=\"text-align: justify;font-size: 1em\">-axis after subsequent substitutions. Equations for rotation about <\/span><em style=\"text-align: justify;font-size: 1em\">X<\/em><span style=\"text-align: justify;font-size: 1em\">-axis can thus be obtained using the above thumb rule as<\/span><\/p>\n<div>\n<p style=\"text-align: center\"><em>x\u2019 = x<\/em><\/p>\n<p style=\"text-align: center\"><em>y\u2019 = y cos\u03b8 <\/em>\u2013<em> z sin\u03b8<\/em><\/p>\n<p style=\"text-align: center\"><em>z\u2019 = y sin\u03b8 <\/em>+<em> zcos\u03b8<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-261 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180.png\" alt=\"\" width=\"326\" height=\"309\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180.png 326w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180-300x284.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180-65x62.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-180-225x213.png 225w\" sizes=\"auto, (max-width: 326px) 100vw, 326px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Equations for rotation about <em>Y<\/em>-axis can similarly be obtained using the above thumb rule and by substituting in the equations for rotation about <em>X<\/em>-axis we get<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><em>x\u2019 = z sin\u03b8 <\/em>+<em> x cos\u03b8<\/em><\/p>\n<p style=\"text-align: center\"><em>y\u2019 = y<\/em><\/p>\n<p style=\"text-align: center\"><em>z\u2019 = z cos<\/em>\u03b8 \u2013<em> x sin\u03b8<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-262 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-181.png\" alt=\"\" width=\"256\" height=\"132\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-181.png 256w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-181-65x34.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-181-225x116.png 225w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-263 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182.png\" alt=\"\" width=\"349\" height=\"178\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182.png 349w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182-300x153.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182-65x33.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-182-225x115.png 225w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div>\n<p><span style=\"text-decoration: underline\">3D Rotation about an axis that is parallel to one of the coordinate axes (say <em>X<\/em>-axis):<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">If we assume that the rotation axis is parallel to <em>X<\/em>-axis then we need to first translate the axis such that it coincides with <em>X<\/em>-axis, and then perform standard rotation about <em>X<\/em>-axis, followed by inverse translation as shown below.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-264 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183.png\" alt=\"\" width=\"662\" height=\"181\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183.png 662w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183-300x82.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183-65x18.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183-225x62.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-183-350x96.png 350w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline\">General 3D rotation about any axis randomly oriented in space:<\/span><\/p>\n<ul>\n<li style=\"text-align: justify\"><em>Translate <\/em>the axis so the rotation axis passes through the origin<\/li>\n<li style=\"text-align: justify\"><em>Rotate <\/em>the axis so that the axis coincides with one of the coordinate (<em>x<\/em>,<em> y<\/em>, or<em> z<\/em>) axes<\/li>\n<li style=\"text-align: justify\">Perform the specified <em>rotation<\/em> about the selected coordinate axis<\/li>\n<li style=\"text-align: justify\">Apply the <em>inverse rotations<\/em> to bring the coordinate axis back to its original orientation<\/li>\n<li style=\"text-align: justify\">Apply the <em>inverse translation<\/em> to bring the rotation axis back to its original spatial location<\/li>\n<\/ul>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-265 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184.png\" alt=\"\" width=\"646\" height=\"265\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184.png 646w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184-300x123.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184-65x27.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184-225x92.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-184-350x144.png 350w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-266 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185.png\" alt=\"\" width=\"667\" height=\"265\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185.png 667w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185-300x119.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185-65x26.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185-225x89.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-185-350x139.png 350w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/p>\n<\/div>\n<div>\n<p>This complex rotation can be represented in notation form as<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-267 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-186.png\" alt=\"\" width=\"229\" height=\"44\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-186.png 229w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-186-65x12.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-186-225x43.png 225w\" sizes=\"auto, (max-width: 229px) 100vw, 229px\" \/><\/p>\n<p><strong>Scaling in 3D:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">It is same as that in 2D, except for the additional scaling factor <em>S<\/em><em>z<\/em> along the z-axis<\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-268 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187.png\" alt=\"\" width=\"392\" height=\"244\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187.png 392w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187-300x187.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187-225x140.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-187-350x218.png 350w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Reflection in 3D:<\/strong><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Reflection in 3D involves a <em>plane of reflection<\/em> with respect to which objects are reflected (unlike 2D reflection which involves axis of reflection). We can consider the standard reflection planes the <em>XY<\/em> plane, whose equation is <em>Z<\/em>=0, the <em>YZ<\/em> plane whose equation is <em>X<\/em>=0 and the <em>XZ<\/em> plane, whose equation is <em>Y<\/em>=0. When we perform reflection with respect to a standard plane say the XY plane, the <em>x<\/em> and <em>y<\/em> coordinates remain the same and the <em>z<\/em>-coordinate gets flipped.<\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-269 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188.png\" alt=\"\" width=\"339\" height=\"233\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188.png 339w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188-300x206.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188-65x45.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-188-225x155.png 225w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The above matrix can be represented in notation form as<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-270 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-189.png\" alt=\"\" width=\"91\" height=\"20\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-189.png 91w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-189-65x14.png 65w\" sizes=\"auto, (max-width: 91px) 100vw, 91px\" \/><\/p>\n<p style=\"text-align: justify\">Where <em>RF<\/em><em>z<\/em> is reflection with respect to <em>Z<\/em>=0 plane (<em>XY<\/em> plane). We can write similar equations for reflections with respect to other standard planes.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Shear in 3D:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Shear in 3D, produces shapes that are deformed, but unlike 2D shear, 3D shear affects planes, i.e., an object gets sheared along a shearing plane. Z-axis shear, represented as <em>SH<\/em><em>z<\/em> is given by<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-271 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-190.png\" alt=\"\" width=\"189\" height=\"128\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-190.png 189w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-190-65x44.png 65w\" sizes=\"auto, (max-width: 189px) 100vw, 189px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Parameters, <em>a<\/em> and <em>b<\/em> in the matrix shown above, can be assigned any real values. The effect of this transformation is to shear X and Y values by an amount proportional to the z-value i.e., to shear planes of constant <em>Z<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Summary:<\/strong><\/p>\n<ul>\n<li>Learnt coordinate system conventions.<\/li>\n<li style=\"text-align: justify\">Learnt basic 3D Transformations including Translation, Rotation and Scaling, Rotation about an arbitrary axis.<\/li>\n<li>Other transformations including Reflection, shear.<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on 3D Transformations<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/yReIQWSnwys\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-272 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191.png\" alt=\"\" width=\"646\" height=\"330\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191.png 646w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191-300x153.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191-65x33.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191-225x115.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-191-350x179.png 350w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n","protected":false},"author":3,"menu_order":14,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-t-raghuveera"],"pb_section_license":""},"chapter-type":[],"contributor":[59],"license":[],"class_list":["post-248","chapter","type-chapter","status-publish","hentry","contributor-dr-t-raghuveera"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":9,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/248\/revisions"}],"predecessor-version":[{"id":621,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/248\/revisions\/621"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/248\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapter-type?post=248"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/contributor?post=248"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/license?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}