Unit-4 Computer-Graphics
Bachelor of computer application (Mahatma Jyotiba Phule Rohilkhand University)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Unit-4 Computer-Graphics
Bachelor of computer application (Mahatma Jyotiba Phule Rohilkhand University)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Three Dimensional Transformations:
The geometric transformations play a vital role in generating images of three Dimensional
objects with the help of these transformations. The location of objects relative to others can be
easily expressed. Sometimes viewpoint changes rapidly, or sometimes objects move in relation
to each other. For this number of transformation can be carried out repeatedly.
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. Translation in the x-direction is represented using Tx. The translation is y-direction is
represented using Ty. The translation in the z- direction is represented using Tz.
If P is a point having co-ordinates in three directions (x, y, z) is translated, then after translation
its coordinates will be (x1 y1 z1) after translation. Tx Ty Tz are translation vectors in x, y, and z
directions respectively.
x1=x+Tx
y1=y+Ty
z1=z+ Tz
Three-dimensional transformations are performed by transforming each vertex of the object. If
an object has five corners, then the translation will be accomplished by translating all five points
to new locations. Following figure 1 shows the translation of point figure 2 shows the translation
of the cube.
Figure 1 Figure 2
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Matrix for translation
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
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
= [5+0+0+30+6+0+30+0+7+20+0+0+1] = [8991]
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
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Scaling of the object relative to a fixed point
Following are steps performed when scaling of objects with fixed point (a, b, c). It can be
represented as below:
1. Translate fixed point to the origin
2. Scale the object relative to the origin
3. Translate object back to its original position.
Note: If all scaling factors Sx=Sy=Sz.Then scaling is called as uniform. If scaling is done with
different scaling vectors, it is called a differential scaling.
In figure (a) point (a, b, c) is shown, and object whose scaling is to done also shown in steps in
fig (b), fig (c) and fig (d).
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
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.
Following figures shows rotation about x, y, z- axis
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Following figure show rotation of the object about the Y axis
Following figure show rotation of the object about the Z axis
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Viewing in 3D: Projections:
Viewing in 3D refers to the process of representing a three-dimensional scene on a two-
dimensional surface, such as a computer screen. In computer graphics, this involves transforming
the coordinates of objects in a 3D scene into 2D coordinates that can be displayed on a flat
screen.
he process of viewing in 3D involves several steps, including defining a virtual camera or
viewpoint, projecting the 3D scene onto a viewing plane, and applying various transformations
to simulate the perception of depth and distance.
1.) Virtual Camera or Viewpoint: The virtual camera represents the viewer's
perspective within the 3D scene. It is defined by its position, orientation, and other
attributes such as field of view. The camera determines what part of the scene will be
visible and how objects will appear from a particular viewpoint.
2.) Projection: Projection is the process of mapping the 3D scene onto a 2D viewing
plane. There are different projection techniques used in computer graphics, including
orthographic projection and perspective projection.
• Orthographic Projection: In orthographic projection, parallel lines in the 3D
scene remain parallel in the 2D projection. This technique is often used in
technical drawings and architectural renderings. It does not simulate realistic
depth perception but provides an accurate representation of object sizes and
proportions.
• Perspective Projection: Perspective projection mimics the way human vision
works by simulating depth and distance perception. It uses a focal point or
viewpoint to create a sense of perspective. Objects that are farther away from the
camera appear smaller, and parallel lines converge towards a vanishing point.
This technique is commonly used in rendering realistic 3D scenes.
3.) View Transformations: Before the projection, various transformations are applied
to the objects in the scene to position and orient them correctly with respect to the virtual
camera. These transformations include translation, rotation, and scaling.
• Translation: It involves moving objects from one location to another in 3D
space. This transformation is used to position the objects within the scene.
• Rotation: Rotation transforms objects by rotating them around a specified axis. It
is used to change the orientation of objects in the scene.
• Scaling: Scaling involves changing the size of objects. It is used to resize objects
in the scene, making them appear larger or smaller.
4.) Clipping and Culling: Clipping is the process of removing portions of objects that
fall outside the viewing volume or frustum. This ensures that only the visible parts of
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
objects are rendered. Culling refers to the removal of objects that are entirely outside the
viewing volume, further improving rendering performance.
5.) Rendering: After the transformation and projection steps, the 2D representation of the
3D scene is sent to the rendering pipeline. This pipeline applies shading, lighting, and
other techniques to compute the final colors and textures of the objects. The rendered
image is then displayed on the screen.
Rotation about Arbitrary Axis
When the object is rotated about an axis that is not parallel to any one of co-ordinate axis, i.e., x,
y, z. Then additional transformations are required. First of all, alignment is needed, and then the
object is being back to the original position. Following steps are required
• Translate the object to the origin
• Rotate object so that axis of object coincide with any of coordinate axis.
• Perform rotation about co-ordinate axis with whom coinciding is done.
• Apply inverse rotation to bring rotation back to the original position.
Matrix for representing three-dimensional
rotations about the Z axis
Matrix for representing three-dimensional
rotations about the X axis
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Matrix for representing three-dimensional
rotations about the Y axis
Following figure show the original position of object and position of object after rotation about
the x-axis
5. Apply inverse translation to bring rotation axis to the original position.
For such transformations, composite transformations are required. All the above steps are applied
on points P' and P".Each step is explained using a separate figure.
Step1: Initial position of P' and P"is shown
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Step2: Translate object P' to origin
Step3: Rotate P" to z axis so that it aligns along the z-axis
Step4: Rotate about around z- axis
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Step5: Rotate axis to the original position
Step6: Translate axis to the original position.
Mathematics of Planar Geometric Projections:
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
Planar geometric projections are an essential part of computer graphics that allow us to represent
three-dimensional objects on a two-dimensional surface, such as a computer screen or a piece of
paper. The mathematics behind planar geometric projections involve various concepts and
techniques that help us accurately represent the shapes, sizes, and orientations of objects in the
3D space.
1.) Coordinate Systems:To understand planar geometric projections, we need to establish a
coordinate system. In computer graphics, the most commonly used coordinate system is
the Cartesian coordinate system, where a point in space is represented by three
coordinates (x, y, z). The x-axis is typically horizontal, the y-axis is vertical, and the z-
axis is perpendicular to the screen, pointing towards or away from the viewer.
2.) Perspective Projection: One of the most widely used projections in computer
graphics is the perspective projection. It mimics how we perceive objects in the real
world by simulating a viewpoint and projecting the 3D scene onto a 2D plane.
To perform perspective projection, we need to define a viewpoint or camera position,
along with other parameters like field of view, aspect ratio, and near/far clipping planes.
The projection process involves casting rays from the viewpoint through each object
point and finding their intersections with the viewing plane. The resulting 2D coordinates
on the viewing plane are then used to render the scene.
The perspective projection involves various mathematical operations, including matrix
transformations and homogeneous coordinates, to map the 3D points onto the 2D plane
accurately.
3.) Orthographic Projection: Another common type of planar projection used in
computer graphics is the orthographic projection. Unlike perspective projection, which
mimics realistic viewing, orthographic projection represents objects as if they were
projected onto a flat plane parallel to the viewing direction. It is often used in technical
drawings, architectural plans, and certain stylized graphics.
In orthographic projection, the 3D coordinates of the object points are directly projected
onto a 2D plane perpendicular to the viewing direction. There is no distance-based
scaling, as in perspective projection. The resulting 2D coordinates are simply a projection
of the object's original shape and size.
4.) Transformation Matrices: Transformation matrices play a crucial role in planar
geometric projections. They allow us to perform various operations such as translation,
rotation, scaling, and shearing on the 3D objects before projecting them onto a 2D plane.
By applying the appropriate transformation matrices, we can modify the position,
orientation, and size of objects in 3D space. These transformations are crucial for
positioning the objects relative to the camera viewpoint and adjusting their appearance in
the final 2D projection.
5.) Clipping and Visibility: In computer graphics, we often deal with objects that
extend beyond the viewing volume or intersect with other objects. To ensure that only the
visible portions are projected onto the 2D plane, we perform clipping operations.
Clipping involves determining which parts of the objects are within the viewing volume
and discarding or truncating the parts outside it. This process helps remove unwanted
elements and ensures that only the visible geometry is projected onto the final image.
Various algorithms, such as the Cohen-Sutherland algorithm or the Liang-Barsky
algorithm, are used to efficiently perform clipping in planar geometric projections.
6.) Hidden Surface Removal: When projecting complex 3D scenes, it is essential to
consider which surfaces are visible and which are hidden behind other objects. This
process, known as hidden surface removal, helps create a realistic representation of the
scene.
Hidden surface removal algorithms, such as the depth-buffer method or the z-buffer
algorithm, determine the visibility of surfaces by comparing their depths or distances
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
from the viewpoint. Only the visible surfaces are projected onto the 2D plane, while the
hidden surfaces are discarded.
Implementation of Planar Geometric Projections:
In computer graphics, planar geometric projections are techniques used to represent three-
dimensional (3D) objects or scenes on a two-dimensional (2D) surface, such as a computer
screen or a piece of paper. These projections are essential for creating realistic and visually
appealing graphics by mimicking the way our eyes perceive objects in the real world.
There are several types of planar geometric projections commonly used in computer graphics,
including orthographic projection, perspective projection, and oblique projection. Each
projection method has its characteristics and is suitable for different applications.
1.) Orthographic Projection: Orthographic projection, also known as parallel projection,
represents 3D objects by projecting them onto a 2D plane without accounting for
perspective. This projection technique is often used in technical drawings, architectural
plans, and engineering diagrams, where accurate measurements and proportions are
crucial. In orthographic projection, parallel lines in the 3D space remain parallel in the
2D representation, resulting in a "flattened" appearance.
Orthographic projection can be further divided into three subtypes:
• Top view (or plan view): The object is projected onto a plane looking from the
top.
• Front view (or elevation view): The object is projected onto a plane looking from
the front.
• Side view (or profile view): The object is projected onto a plane looking from the
side.
2.) Perspective Projection: Perspective projection aims to create a realistic
representation of how objects appear in our visual perception. It takes into account the
concept of vanishing points, which occur due to the way parallel lines converge in the
distance. In perspective projection, objects that are closer to the viewer appear larger,
while those farther away appear smaller.
To achieve perspective projection, a mathematical transformation called the perspective
transformation matrix is applied to the 3D coordinates of the objects. This transformation
considers the viewer's position, the position of the object in 3D space, and the field of
view. The resulting projection creates the illusion of depth and spatial relationships,
enhancing the realism of the rendered scene.
3.) Oblique Projection: Oblique projection is a less common projection technique that
involves projecting the 3D objects onto a plane at an angle. It provides an asymmetrical
representation where the object's depth is maintained but with foreshortening effects.
Oblique projection is often used for artistic or stylistic purposes, as it can create unique
and visually interesting effects.
There are two main types of oblique projection:
• Cavalier projection: In this type, the depth of the object remains unchanged,
resulting in an exaggerated appearance of the object's height. The angles between
the projected lines and the original lines are maintained.
• Cabinet projection: In cabinet projection, the depth of the object is reduced by
half, resulting in a more realistic foreshortening effect. The angles between the
projected lines and the original lines are halved.
In computer graphics, the implementation of planar geometric projections involves transforming
the 3D coordinates of the objects or vertices in a 3D scene into their corresponding 2D
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779
coordinates in the projected image. This transformation is typically performed using
mathematical calculations and matrices.
For orthographic projection, the process involves projecting the objects onto a plane parallel to
the viewing plane, where the size and position of the objects are preserved. Perspective
projection, on the other hand, requires considering the viewer's position, the position of the
objects, and the field of view to calculate the appropriate transformation matrix for each vertex.
Oblique projection follows a similar process, but with specific angles and transformations
depending on the chosen type.
Once the 2D coordinates are obtained through projection, the graphics engine can render the
objects on the 2D surface, taking into account lighting, shading, and other rendering techniques
to enhance the visual quality and realism of the scene.
Downloaded by Pradeep gupta (pradeep13022002@gmail.com)
lOMoARcPSD|38515779

unit-4-computer-graphics.pdf . VERY USE FULL

  • 1.
    Unit-4 Computer-Graphics Bachelor ofcomputer application (Mahatma Jyotiba Phule Rohilkhand University) Scan to open on Studocu Studocu is not sponsored or endorsed by any college or university Unit-4 Computer-Graphics Bachelor of computer application (Mahatma Jyotiba Phule Rohilkhand University) Scan to open on Studocu Studocu is not sponsored or endorsed by any college or university Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 2.
    Three Dimensional Transformations: Thegeometric transformations play a vital role in generating images of three Dimensional objects with the help of these transformations. The location of objects relative to others can be easily expressed. Sometimes viewpoint changes rapidly, or sometimes objects move in relation to each other. For this number of transformation can be carried out repeatedly. 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. Translation in the x-direction is represented using Tx. The translation is y-direction is represented using Ty. The translation in the z- direction is represented using Tz. If P is a point having co-ordinates in three directions (x, y, z) is translated, then after translation its coordinates will be (x1 y1 z1) after translation. Tx Ty Tz are translation vectors in x, y, and z directions respectively. x1=x+Tx y1=y+Ty z1=z+ Tz Three-dimensional transformations are performed by transforming each vertex of the object. If an object has five corners, then the translation will be accomplished by translating all five points to new locations. Following figure 1 shows the translation of point figure 2 shows the translation of the cube. Figure 1 Figure 2 Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 3.
    Matrix for translation Matrixrepresentation 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 Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 4.
    = [5+0+0+30+6+0+30+0+7+20+0+0+1] =[8991] 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 Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 5.
    Scaling of theobject relative to a fixed point Following are steps performed when scaling of objects with fixed point (a, b, c). It can be represented as below: 1. Translate fixed point to the origin 2. Scale the object relative to the origin 3. Translate object back to its original position. Note: If all scaling factors Sx=Sy=Sz.Then scaling is called as uniform. If scaling is done with different scaling vectors, it is called a differential scaling. In figure (a) point (a, b, c) is shown, and object whose scaling is to done also shown in steps in fig (b), fig (c) and fig (d). Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 6.
    Downloaded by Pradeepgupta ([email protected]) lOMoARcPSD|38515779
  • 7.
    Rotation It is movingof 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. Following figures shows rotation about x, y, z- axis Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 8.
    Following figure showrotation of the object about the Y axis Following figure show rotation of the object about the Z axis Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 9.
    Viewing in 3D:Projections: Viewing in 3D refers to the process of representing a three-dimensional scene on a two- dimensional surface, such as a computer screen. In computer graphics, this involves transforming the coordinates of objects in a 3D scene into 2D coordinates that can be displayed on a flat screen. he process of viewing in 3D involves several steps, including defining a virtual camera or viewpoint, projecting the 3D scene onto a viewing plane, and applying various transformations to simulate the perception of depth and distance. 1.) Virtual Camera or Viewpoint: The virtual camera represents the viewer's perspective within the 3D scene. It is defined by its position, orientation, and other attributes such as field of view. The camera determines what part of the scene will be visible and how objects will appear from a particular viewpoint. 2.) Projection: Projection is the process of mapping the 3D scene onto a 2D viewing plane. There are different projection techniques used in computer graphics, including orthographic projection and perspective projection. • Orthographic Projection: In orthographic projection, parallel lines in the 3D scene remain parallel in the 2D projection. This technique is often used in technical drawings and architectural renderings. It does not simulate realistic depth perception but provides an accurate representation of object sizes and proportions. • Perspective Projection: Perspective projection mimics the way human vision works by simulating depth and distance perception. It uses a focal point or viewpoint to create a sense of perspective. Objects that are farther away from the camera appear smaller, and parallel lines converge towards a vanishing point. This technique is commonly used in rendering realistic 3D scenes. 3.) View Transformations: Before the projection, various transformations are applied to the objects in the scene to position and orient them correctly with respect to the virtual camera. These transformations include translation, rotation, and scaling. • Translation: It involves moving objects from one location to another in 3D space. This transformation is used to position the objects within the scene. • Rotation: Rotation transforms objects by rotating them around a specified axis. It is used to change the orientation of objects in the scene. • Scaling: Scaling involves changing the size of objects. It is used to resize objects in the scene, making them appear larger or smaller. 4.) Clipping and Culling: Clipping is the process of removing portions of objects that fall outside the viewing volume or frustum. This ensures that only the visible parts of Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 10.
    objects are rendered.Culling refers to the removal of objects that are entirely outside the viewing volume, further improving rendering performance. 5.) Rendering: After the transformation and projection steps, the 2D representation of the 3D scene is sent to the rendering pipeline. This pipeline applies shading, lighting, and other techniques to compute the final colors and textures of the objects. The rendered image is then displayed on the screen. Rotation about Arbitrary Axis When the object is rotated about an axis that is not parallel to any one of co-ordinate axis, i.e., x, y, z. Then additional transformations are required. First of all, alignment is needed, and then the object is being back to the original position. Following steps are required • Translate the object to the origin • Rotate object so that axis of object coincide with any of coordinate axis. • Perform rotation about co-ordinate axis with whom coinciding is done. • Apply inverse rotation to bring rotation back to the original position. Matrix for representing three-dimensional rotations about the Z axis Matrix for representing three-dimensional rotations about the X axis Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 11.
    Matrix for representingthree-dimensional rotations about the Y axis Following figure show the original position of object and position of object after rotation about the x-axis 5. Apply inverse translation to bring rotation axis to the original position. For such transformations, composite transformations are required. All the above steps are applied on points P' and P".Each step is explained using a separate figure. Step1: Initial position of P' and P"is shown Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 12.
    Step2: Translate objectP' to origin Step3: Rotate P" to z axis so that it aligns along the z-axis Step4: Rotate about around z- axis Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 13.
    Step5: Rotate axisto the original position Step6: Translate axis to the original position. Mathematics of Planar Geometric Projections: Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 14.
    Planar geometric projectionsare an essential part of computer graphics that allow us to represent three-dimensional objects on a two-dimensional surface, such as a computer screen or a piece of paper. The mathematics behind planar geometric projections involve various concepts and techniques that help us accurately represent the shapes, sizes, and orientations of objects in the 3D space. 1.) Coordinate Systems:To understand planar geometric projections, we need to establish a coordinate system. In computer graphics, the most commonly used coordinate system is the Cartesian coordinate system, where a point in space is represented by three coordinates (x, y, z). The x-axis is typically horizontal, the y-axis is vertical, and the z- axis is perpendicular to the screen, pointing towards or away from the viewer. 2.) Perspective Projection: One of the most widely used projections in computer graphics is the perspective projection. It mimics how we perceive objects in the real world by simulating a viewpoint and projecting the 3D scene onto a 2D plane. To perform perspective projection, we need to define a viewpoint or camera position, along with other parameters like field of view, aspect ratio, and near/far clipping planes. The projection process involves casting rays from the viewpoint through each object point and finding their intersections with the viewing plane. The resulting 2D coordinates on the viewing plane are then used to render the scene. The perspective projection involves various mathematical operations, including matrix transformations and homogeneous coordinates, to map the 3D points onto the 2D plane accurately. 3.) Orthographic Projection: Another common type of planar projection used in computer graphics is the orthographic projection. Unlike perspective projection, which mimics realistic viewing, orthographic projection represents objects as if they were projected onto a flat plane parallel to the viewing direction. It is often used in technical drawings, architectural plans, and certain stylized graphics. In orthographic projection, the 3D coordinates of the object points are directly projected onto a 2D plane perpendicular to the viewing direction. There is no distance-based scaling, as in perspective projection. The resulting 2D coordinates are simply a projection of the object's original shape and size. 4.) Transformation Matrices: Transformation matrices play a crucial role in planar geometric projections. They allow us to perform various operations such as translation, rotation, scaling, and shearing on the 3D objects before projecting them onto a 2D plane. By applying the appropriate transformation matrices, we can modify the position, orientation, and size of objects in 3D space. These transformations are crucial for positioning the objects relative to the camera viewpoint and adjusting their appearance in the final 2D projection. 5.) Clipping and Visibility: In computer graphics, we often deal with objects that extend beyond the viewing volume or intersect with other objects. To ensure that only the visible portions are projected onto the 2D plane, we perform clipping operations. Clipping involves determining which parts of the objects are within the viewing volume and discarding or truncating the parts outside it. This process helps remove unwanted elements and ensures that only the visible geometry is projected onto the final image. Various algorithms, such as the Cohen-Sutherland algorithm or the Liang-Barsky algorithm, are used to efficiently perform clipping in planar geometric projections. 6.) Hidden Surface Removal: When projecting complex 3D scenes, it is essential to consider which surfaces are visible and which are hidden behind other objects. This process, known as hidden surface removal, helps create a realistic representation of the scene. Hidden surface removal algorithms, such as the depth-buffer method or the z-buffer algorithm, determine the visibility of surfaces by comparing their depths or distances Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 15.
    from the viewpoint.Only the visible surfaces are projected onto the 2D plane, while the hidden surfaces are discarded. Implementation of Planar Geometric Projections: In computer graphics, planar geometric projections are techniques used to represent three- dimensional (3D) objects or scenes on a two-dimensional (2D) surface, such as a computer screen or a piece of paper. These projections are essential for creating realistic and visually appealing graphics by mimicking the way our eyes perceive objects in the real world. There are several types of planar geometric projections commonly used in computer graphics, including orthographic projection, perspective projection, and oblique projection. Each projection method has its characteristics and is suitable for different applications. 1.) Orthographic Projection: Orthographic projection, also known as parallel projection, represents 3D objects by projecting them onto a 2D plane without accounting for perspective. This projection technique is often used in technical drawings, architectural plans, and engineering diagrams, where accurate measurements and proportions are crucial. In orthographic projection, parallel lines in the 3D space remain parallel in the 2D representation, resulting in a "flattened" appearance. Orthographic projection can be further divided into three subtypes: • Top view (or plan view): The object is projected onto a plane looking from the top. • Front view (or elevation view): The object is projected onto a plane looking from the front. • Side view (or profile view): The object is projected onto a plane looking from the side. 2.) Perspective Projection: Perspective projection aims to create a realistic representation of how objects appear in our visual perception. It takes into account the concept of vanishing points, which occur due to the way parallel lines converge in the distance. In perspective projection, objects that are closer to the viewer appear larger, while those farther away appear smaller. To achieve perspective projection, a mathematical transformation called the perspective transformation matrix is applied to the 3D coordinates of the objects. This transformation considers the viewer's position, the position of the object in 3D space, and the field of view. The resulting projection creates the illusion of depth and spatial relationships, enhancing the realism of the rendered scene. 3.) Oblique Projection: Oblique projection is a less common projection technique that involves projecting the 3D objects onto a plane at an angle. It provides an asymmetrical representation where the object's depth is maintained but with foreshortening effects. Oblique projection is often used for artistic or stylistic purposes, as it can create unique and visually interesting effects. There are two main types of oblique projection: • Cavalier projection: In this type, the depth of the object remains unchanged, resulting in an exaggerated appearance of the object's height. The angles between the projected lines and the original lines are maintained. • Cabinet projection: In cabinet projection, the depth of the object is reduced by half, resulting in a more realistic foreshortening effect. The angles between the projected lines and the original lines are halved. In computer graphics, the implementation of planar geometric projections involves transforming the 3D coordinates of the objects or vertices in a 3D scene into their corresponding 2D Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779
  • 16.
    coordinates in theprojected image. This transformation is typically performed using mathematical calculations and matrices. For orthographic projection, the process involves projecting the objects onto a plane parallel to the viewing plane, where the size and position of the objects are preserved. Perspective projection, on the other hand, requires considering the viewer's position, the position of the objects, and the field of view to calculate the appropriate transformation matrix for each vertex. Oblique projection follows a similar process, but with specific angles and transformations depending on the chosen type. Once the 2D coordinates are obtained through projection, the graphics engine can render the objects on the 2D surface, taking into account lighting, shading, and other rendering techniques to enhance the visual quality and realism of the scene. Downloaded by Pradeep gupta ([email protected]) lOMoARcPSD|38515779