Computer Graphics Assignment
Computer Graphics Assignment
a.) The Cohen Sutherland line clipping algorithm is one of the most popular algorithms used. Give a
detailed description on this algorithm paying attention to the following:
i.) Boundary creation for the viewport
We are given 9 regions on the screen. Out of which one region is of the window
and the rest 8 regions are around it given by 4 digit binary.
The division of the regions is based on (x-max; y-max; x-min; y-min)
The central part is the viewing region or window, all the lines which lie within
this region are completely visible.
Question 2
a.) Find a transformation of triangle A(1.0) B(0.1) C(1.1)
i.) Rotating 45 about origin and then translating one unit in x and y
directions
1. Rotate the triangle 45° about the origin:
a.) Give a detailed explanation of the steps alongside the rotation matrix used at each stage.
Step 1 : Translation ( T )
Move the object to origin (0.0) in the world coordinate system
Rotation matrix which is identified by matrix (I)
Step 2: Rotation
Perspective Parallel
Refers to the different viewpoints or Refers to the simultaneous development
lenses through which the architecture and integration of different architectural
is analyzed and understood. components or modules.
Involves considering the architecture Involves breaking down the overall solution
from various stakeholder perspectives, into smaller, manageable parts that can be
such as business owners, end-users, IT worked on independently but still contribute
teams, and others. to the overall architecture.
Each perspective provides unique Working in parallel accelerates the
insights and requirements that must development process, increases efficiency,
be considered during the design and enables effective collaboration among
process. teams.
Helps ensure that the solution meets Allows for better coordination and
the needs and expectations of all integration of the different components,
stakeholders. leading to a more cohesive and holistic
solution.
*The computer graphics pipeline is a series of stages or steps that graphics data goes
through to be rendered on a screen or display.
1. Application Stage: In this stage, the application or software program generates the
geometric data and defines the properties of objects to be rendered. This includes
specifying the vertices, their positions in 3D space, and attributes such as color and
texture coordinates.
2. Geometry Stage: The geometry stage processes the geometric data generated in the
application stage. It performs operations such as vertex transformations, where the
vertices are translated, rotated, and scaled to their correct positions in the 3D world.
This stage also handles operations like clipping, where objects or parts of objects
outside the view frustum are removed.
3. Rasterization Stage: After the geometry stage, the geometric primitives (such as points,
lines, or triangles) are divided into fragments or pixels that will be rendered on the
screen. Rasterization calculates the attributes of each fragment, such as the depth value
and the texture coordinates.
4. Fragment Stage: The fragment stage determines the final color and other attributes of
each fragment. This includes operations such as texture mapping, where textures are
applied to the fragments based on their texture coordinates. Lighting calculations can
also be performed in this stage to determine the shading and reflection properties of
the fragments.
5. Output Stage: In the final stage of the pipeline, the fragments are combined to form the
final image. This includes tasks such as blending, where fragments are combined with
existing pixels on the screen based on their transparency values. The resulting image is
then displayed on the screen or sent to the output device.
Question 4
a.) Describe in detail the two basic projection methods parallel and perspective
projection clearly outling any three type of each projection. Use diagrams
1. Parallel Projection:
Parallel projection is a type of projection where the projection lines are parallel to each
other and do not converge. This projection method is commonly used in technical and
engineering drawings, architectural blueprints, and computer-aided design (CAD)
applications.
a) Orthographic Projection: Orthographic projection is a parallel projection
technique where the projection lines are perpendicular to the viewing plane.
This results in a representation where all lines appear parallel and objects do not
appear foreshortened. It is commonly used in technical drawings to accurately
represent objects from different views, such as top, front, and side views.
b) Isometric Projection: Isometric projection is a type of parallel projection
where the object is projected onto a 2D plane with equal foreshortening along
all axes. This projection method creates a 3D representation that maintains the
proportions and angles of the original object. Isometric projection is often used
in technical illustrations and architectural drawings to provide a clear
understanding of the object's dimensions and spatial relationships.
c) Oblique Projection: Oblique projection is a type of parallel projection where
the object is projected onto the viewing plane at an angle other than 90 degrees.
This projection method creates a distorted representation of the object, with
one set of parallel lines appearing in true scale while the other set appears
foreshortened. Oblique projection is commonly used in architectural and
furniture design to provide a visually appealing representation of objects.
2. Perspective Projection:
Perspective projection is a type of projection where the projection lines converge
towards a vanishing point, simulating the way humans perceive depth in the real world.
This projection method aims to create a more realistic and immersive representation of
objects.
a) One-Point Perspective: One-point perspective is a perspective projection
technique where all parallel lines converge to a single vanishing point. This
technique is often used in architectural drawings to create the illusion of depth
and distance. It provides a sense of depth along a single direction, making
objects appear as if they are receding into the distance.
b) Two-Point Perspective: Two-point perspective is a perspective projection
technique where two sets of parallel lines converge to two different vanishing
points. This technique creates a more realistic representation of objects by
simulating depth along two different directions. Two-point perspective is
commonly used in architectural and interior design to create visually appealing
and accurate representations of objects and spaces.
c) Three-Point Perspective: Three-point perspective is a perspective projection
technique where three sets of parallel lines converge to three different vanishing
points. This technique creates an even more dynamic and immersive
representation by simulating depth along three different directions. Three-point
perspective is often used in artistic drawings and illustrations to create dramatic
and visually striking images