THEORY FILE - Computer Graphics (5th Sem) .
THEORY FILE - Computer Graphics (5th Sem) .
IL
Sahil Kumar Prof.
Program BCA
Course Name ➖
Semester 5th.
Computer Graphics (Theory).
UNIT ➖01
● Introduction to Computer Graphics ➖
# Applications of Computer Graphics. Graphs and Types of Graphs ➖
# Introduction to Computer Graphics ➖
IL
Computer Graphics involves the creation, manipulation, and representation of visual images
using computers. This field encompasses both the hardware and software necessary to create
visual content.
1. Entertainment ➖
I. Movies and Animation: Creating visual effects, animated films, and CGI
H
(Computer-Generated Imagery).
II. Video Games: Developing 2D and 3D graphics for interactive gameplay.
4. Scientific Research ➖
I. Data Visualization: Representing scientific data graphically to identify patterns and insights.
II. Modelling and Simulation: Simulating physical processes and phenomena.
Definition ➖
A graph is a diagrammatic representation of data, where data is displayed using points, lines,
bars, or other shapes to illustrate relationships, trends, or distributions.
Types of Graphs ➖
1. Line Graphs ➖
I. Description: Uses lines to connect data points, showing trends over time.
II. Use Case: Ideal for displaying data that changes continuously, like stock prices or
temperature changes.
IL
2. Bar Graphs
I. Description: Uses rectangular bars to represent data values. Bars can be vertical or
horizontal.
II. Use Case: Suitable for comparing discrete categories or groups, like sales figures for
different products.
3. Pie Charts ➖
of the whole.
H
I. Description: Circular chart divided into sectors, where each sector represents a proportion
II. Use Case: Useful for showing the relative proportions of different categories within a
whole.
4. Scatter Plots ➖
I. Description: Uses dots to represent data points on a two-dimensional plane, showing the
SA
relationship between two variables.
II. Use Case: Ideal for identifying correlations or patterns between variables.
5. Histograms ➖
I. Description: Similar to bar graphs, but used to represent the frequency distribution of
continuous data.
II. Use Case: Commonly used in statistics to show the distribution of data points across
different ranges.
6. Area Graphs ➖
I. Description: Similar to line graphs, but the area under the line is filled in.
II. Use Case: Useful for showing cumulative totals over time, such as revenue growth.
➖
● Input Devices: Light Pens, Graphic Tablets, Joysticks, Track Ball, Data Glove,
Digitizers, Image Scanner
II. Function: Detects light from the screen when the pen touches it, sending signals to the
IL
computer to move the cursor or select objects.
III. Uses: Used in CAD applications, graphic design, and interactive kiosks.
# Graphic Tablet :-
I. Description: A flat surface on which the user can draw or write with a stylus, translating the
movements into digital data.
II.
III.
H
Function: Captures hand-drawn images, signatures, and handwritten text.
Uses: Widely used by artists, designers, and architects for precise drawing and sketching.
# Joystick ➖
I. Description: A stick that pivots on a base and reports its angle or direction to the device it is
SA
controlling.
II. Function: Allows users to control the movement of an object on the screen by tilting the
stick in various directions.
# Trackball ➖
I. Description: A pointing device consisting of a ball held in a socket that can be rotated to
move the cursor on the screen.
II. Function: The user rolls the ball with their fingers or palm to navigate.
III. Uses: Used in CAD applications, video editing, and for users with limited desk space.
# Data Glove ➖
I. Description: A glove fitted with sensors that detect the movement and position of the hand
and fingers.
II. Function: Translates hand movements into digital signals for computer interaction.
III. Uses: Used in virtual reality, robotics, and for gesture-based control in various applications.
➖
4
# Digitizer
I. Description: Converts analog information into a digital format.
II. Function: Used to capture the coordinates of points on a physical object, translating them
into digital data.
III. Uses: Common in CAD, mapping, and digital archiving of drawings and blueprints.
# Image Scanner ➖
I. Description: A device that captures images from photographic prints, posters, magazine
pages, and similar sources for computer editing and display.
II. Function: Converts physical documents and images into digital format.
III. Uses: Used in digitising documents, archiving photographs, and in graphic design for
image editing and manipulation.
IL
Understanding these input devices helps in choosing the appropriate tools for specific tasks in
computer graphics and related fields.
● Video Display Devices: Refresh Cathode Ray Tube, Raster Scan displays, Random
Scan displays, Color CRT - monitors and Color generating techniques (Shadow
➖
Mask, Beam Penetration), Flat-Panel Displays; 3-D Viewing Devices, Graphics
H
monitors and workstations, Colour Models (RGB and CMY), Lookup Table
# Shadow Mask ➖
I. Description: A method used in colour CRT monitors where a metal sheet with tiny holes
aligns the electron beams with the correct phosphor dots.
II. Function: Three electron guns (red, green, blue) aim through the shadow mask to create
colour images by illuminating the correct phosphor dots.
III. Uses: Common in traditional colour CRT monitors.
# Beam Penetration ➖
I. Description: Technique used in older colour CRTs where the depth of electron beam
penetration into the phosphor coating determines the colour.
IL
II. Function: Different energy levels of the electron beam excite different phosphor layers to
produce various colours.
# Flat-Panel Displays ➖
I. Description: Modern display devices that use various technologies to produce images
H
without the bulk of CRTs.
II. Types: Includes LCD (Liquid Crystal Display), LED (Light Emitting Diode), OLED (Organic
LED), and plasma screens.
III. Uses: Widely used in computers, televisions, smartphones, and other digital devices.
➖
➖
# Colour Models
1. RGB (Red, Green, Blue)
I. Description: Additive colour model where colours are created by combining red, green, and
blue light.
II. Uses: Used in digital displays, cameras, and scanners.
II. Function: Allows for precise control over colour correction, gamma correction, and other
image adjustments.
III. Uses: Commonly used in graphics software, image processing, and digital displays for
colour management.
Understanding these video display devices and concepts is essential for anyone working with
IL
computer graphics, ensuring the selection of appropriate technology for various applications and
improving the quality of visual output.
➖
● Introduction Virtual Reality & Environments: Applications in Engineering,
Architecture, Education, Medicine, Entertainment, Science, Training
➖
H
# Introduction to Virtual Reality (VR) and Environments
Definition
Virtual Reality (VR) refers to a simulated experience that can be similar to or completely different
from the real world. It typically involves the use of VR headsets and other sensory equipment to
create an immersive environment.
# Components of VR Systems ➖
SA
I. Head-Mounted Displays (HMDs): Devices worn on the head that provide visual and
auditory immersion.
II. Motion Tracking: Sensors that track the movement of the user’s head and body to adjust
the virtual environment accordingly.
III. Haptic Feedback: Technology that simulates the sense of touch by applying forces,
vibrations, or motions to the user.
IV. Input Devices: Controllers, gloves, or other devices that allow users to interact with the
virtual environment.
3. Education ➖
I. Interactive Learning: Providing immersive learning experiences that enhance
understanding and retention of complex subjects.
II. Virtual Classrooms: Allowing remote students to participate in virtual lectures and group
activities.
IL
III. Historical Reenactments: Enabling students to experience historical events and locations in
a virtual setting.
4. Medicine➖
I. Surgical Training: Allowing medical professionals to practise surgical procedures in a
risk-free virtual environment.
II. Therapy and Rehabilitation: Using VR for physical therapy and mental health treatments,
H
such as exposure therapy for phobias.
III. Medical Visualisation: Helping doctors and students visualise and interact with complex
anatomical structures.
5.Entertainment ➖
I. Gaming: Creating immersive gaming experiences where players can interact with virtual
worlds.
SA
II. Virtual Theme Parks: Offering rides and experiences that are not possible in the physical
world.
III. Movies and Interactive Stories: Providing new forms of storytelling where viewers can
interact with the narrative.
6. Science➖
I. Scientific Visualisation: Allowing researchers to visualise complex data sets and
simulations in an immersive environment.
II. Virtual Laboratories: Enabling scientists to conduct experiments in a controlled virtual
setting.
III. Astronomical Exploration: Simulating space environments for educational and research
purposes.
7. Training ➖
I. Military Training: Simulating combat scenarios to train soldiers in a safe and controlled
environment.
II. Pilot Training: Using flight simulators to train pilots without the risks associated with real
flights.
8
III. Industrial Training: Teaching workers to operate machinery and handle hazardous
materials in a virtual environment.
By leveraging the power of VR, these applications enhance productivity, safety, and engagement
across various fields.
IL
H
SA
9
UNIT ➖ 02
● Scan-conversions ➖
# Process and need of Scan Conversion, Scan conversion algorithms for Line, Circle and
Ellipse using direct method, Bresenham's algorithms for line & circle and Midpoint Ellipse
➖
Algorithm along with their derivations, Area Filling Techniques, Flood Fill Techniques,
Character Generation
IL
Scan-Conversions
Direct Method
I. Description: Calculates the slope of the line and uses it to determine the intermediate
pixel positions.
SA
II. Algorithm: For a line with endpoints (x0,y0)(x_0, y_0)(x0,y0) and (x1,y1)(x_1, y_1)(x1,y1):
slope=m=y1−y0x1−x0\text{slope} = m = \frac{y_1 - y_0}{x_1 - x_0}slope=m=x1−x0y1−y0
y=y0+m(x−x0)y = y_0 + m(x - x_0)y=y0+m(x−x0)
III. Limitations: Can be inefficient and produce jagged lines due to floating-point operations.
I. Description: An efficient algorithm that uses only integer arithmetic to determine the pixels
along a line.
II. Algorithm:
A. Initialise the decision parameter p0=2Δy−Δxp_0 = 2\Delta y - \Delta xp0=2Δy−Δx.
B. For each xxx from x0x_0x0to x1x_1x1:
1. If pk<0p_k < 0pk<0, the next point is (xk+1,yk)(x_{k+1}, y_k)(xk+1,yk).
2. Otherwise, the next point is (xk+1,yk+1)(x_{k+1}, y_{k+1})(xk+1,yk+1) and
update pk+1=pk+2(Δy−Δx)p_{k+1} = p_k + 2(\Delta y - \Delta
x)pk+1=pk+2(Δy−Δx).
2. Circle Scan Conversion
Direct Method
IL
y=y−1y = y - 1y=y−1.
3. Ellipse Scan Conversion
# Character Generation ➖
I. Bitmap Method: Uses a bitmap for each character where each bit represents a pixel.
II. Outline Method: Uses vector data to define the outlines of characters, which are then filled
to produce the characters.
By understanding these scan-conversion algorithms and techniques, you can efficiently render
various geometric shapes and fill areas in computer graphics applications.
➖ 03
11
UNIT
● 2 – Dimensional Graphics ➖
# Cartesian and need of Homogeneous co-ordinate system, Geometric transformations
(Translation, Scaling, Rotation, Reflection, Shearing), Viewing transformation and clipping
➖
(line, polygon and text) using CohenSutherland, Sutherland Hodgeman and Liang Barsky
algorithm for clipping
2-Dimensional Graphics ➖
IL
# Cartesian and Homogeneous Coordinate Systems ➖
1. Cartesian Coordinate System: ➖
I. Description: A coordinate system that specifies each point uniquely in a plane by a pair of
numerical coordinates (x, y).
II. Need: Simplifies the representation and manipulation of geometric figures by using linear
algebra.
➖
I.
H
2. Homogeneous Coordinate System:
➖
SA
# Geometric Transformations
1. Translation
○ Formula: (x′y′1) = (10tx01ty001) (xy1) \begin{pmatrix} x' \\ y' \\ 1 \end{pmatrix} =
\begin{pmatrix} 1 & 0 & tx \\ 0 & 1 & ty \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y
\\ 1 \end{pmatrix}x′y′1=100010txty1xy1
○ Description: Moves every point of an object by a certain distance in a specified
direction.
2. Scaling
○ Formula: (x′y′1)=(sx000sy0001)(xy1)\begin{pmatrix} x' \\ y' \\ 1 \end{pmatrix} =
\begin{pmatrix} sx & 0 & 0 \\ 0 & sy & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\
y \\ 1 \end{pmatrix}x′y′1=sx000sy0001xy1
○ Description: Changes the size of an object by a scale factor along the x and y axes.
3. Rotation
○ Formula: (x′y′1)=(cosθ−sinθ0sinθcosθ0001)(xy1)\begin{pmatrix} x' \\ y' \\ 1
\end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta &
0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1
\end{pmatrix}x′y′1=cosθsinθ0−sinθcosθ0001x y1
○ Description: Rotates an object around the origin by an angle θ.
12
4. Reflection
○ Formula for reflection across x-axis: (x′y′1)=(1000−10001)(xy1)\begin{pmatrix} x'
\\ y' \\ 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1
\end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix}x′y′1=1000−10001xy1
○ Description: Produces a mirror image of an object.
5. Shearing
○ Formula for x-shear: (x′y′1) = (1shx0010001) (xy1) \begin{pmatrix} x' \\ y' \\ 1
\end{pmatrix} = \begin{pmatrix} 1 & sh_x & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}
\begin{pmatrix} x \\ y \\ 1 \end{pmatrix}x′y′1=100shx10001xy1
○ Description: Distorts the shape of an object by shifting its vertices along the x or y
axis.
IL
1. Viewing Transformation
○ Description: Maps a portion of a world coordinate scene to device coordinates.
○ Steps: Involves windowing (selecting a part of the scene) and viewport
transformation (mapping the window to the device's viewport).
2. Line Clipping Algorithms
Cohen-Sutherland Algorithm
○ Description: Uses a divide-and-conquer approach with region codes for efficiently
○ Steps:
H
clipping lines.
By understanding these concepts, you can manipulate and render 2D graphics efficiently,
enabling a wide range of applications in computer graphics and visualisation.
IL
H
SA
14
UNIT ➖ 04
● 3 – Dimensional Graphics Introduction to 3-dimensional Graphics: Geometric
➖
Transformations (Translation, Scaling, Rotation), Mathematics of Projections
(Parallel & Perspective). Colour Shading. Introduction to Morphing techniques
IL
creates more realistic and visually rich images, as compared to 2D graphics.
1. Coordinate Systems
○ 3D Cartesian Coordinate System: Uses three axes (x, y, and z) to define the position of
points in 3D space. The x-axis typically represents width, the y-axis represents
height, and the z-axis represents depth.
2. 3D Objects
H
○ Vertices: The points in 3D space that define the corners of the object.
○ Edges: The lines connecting the vertices.
○ Faces: The flat surfaces enclosed by the edges. Common types of 3D objects
include polygons, polyhedra, and more complex models like meshes.
3. Geometric Transformations
○ Transformations in 3D graphics are used to manipulate objects within the scene.
SA
These include translation, scaling, and rotation.
4. Projections
○ Parallel Projection: Maintains the relative proportions of objects but does not
provide a realistic sense of depth.
○ Perspective Projection: Simulates the way the human eye perceives the world,
where objects appear smaller as they get further away, creating a sense of depth.
5. Rendering Techniques
○ Shading: Determines the color and brightness of surfaces based on light sources
and their interaction with the object.
○ Texture Mapping: Applies images to the surfaces of 3D models to add detail.
○ Ray Tracing: A rendering technique that simulates the way light interacts with
objects to produce highly realistic images.
6. Lighting
○ Ambient Light: General lighting that is present everywhere in the scene.
○ Diffuse Light: Light that scatters in many directions, giving objects a matte
appearance.
○ Specular Light: Light that reflects in a single direction, creating highlights and
contributing to the shiny appearance of surfaces.
15
7. Shading Models
○ Flat Shading: Applies a single color to each polygon, resulting in a faceted look.
○ Gouraud Shading: Interpolates vertex colors across the surface of the polygon.
○ Phong Shading: Interpolates vertex normals and calculates the color for each pixel,
providing smoother shading.
8. Cameras
○ Defines the viewpoint from which the scene is rendered. The camera's position,
orientation, and field of view determine what is visible in the final image.
IL
H
SA
SA
H
IL
16
17
IL
# Colour Shading
I.
➖
H
Flat Shading: Applies a single colour to each polygon.
II. Gouraud Shading: Interpolates vertex colours across the surface of the polygon.
III. Phong Shading: Interpolates vertex normals and calculates the colour for each pixel,
providing smoother shading.
SA
# Introduction to Morphing Techniques ➖
I. Definition: Morphing is a technique that transforms one image or shape into another
through a seamless transition.
II. Steps:
A. Feature Point Identification: Identifying corresponding points in the source and
destination images.
B. Warping: Distorting the source image so that its feature points match those of the
destination image.
C. Cross-dissolving: Gradually changing the pixel values from the source image to
those of the destination image.
By understanding these fundamental concepts, you can effectively work with 3D graphics,
creating realistic images and animations for various applications in computer graphics.
18
1) Write briefly :
IL
a) Explain the working of digitizer.
f) Define Reflection.
H
e) Why is Bresenhem’s algorithm better than DDA?
SECTION A (ANSWERS)
1) Write briefly:
A digitizer is an input device that converts analog signals or physical drawings into digital format.
It typically consists of a flat surface and a stylus or puck. When the stylus or puck is moved over
the surface, sensors detect its position and movements. These movements are then converted
into digital coordinates that can be processed by a computer. Digitizers are often used for
creating precise digital drawings or for capturing hand-drawn designs.
19
b) Differentiate between Flatbed and Drum Plotter.
I. Flatbed Plotter:
A. Structure: Consists of a flat, stationary bed where the paper is placed.
B. Movement: The pen moves in both the X and Y directions over the paper.
C. Use: Suitable for plotting on large sheets of paper and for detailed, accurate
drawings.
D. Size Limitation: Limited by the size of the flatbed.
II. Drum Plotter:
A. Structure: Paper is wrapped around a rotating drum.
B. Movement: The drum rotates to move the paper along one axis, while the pen
moves along the other axis.
C. Use: Capable of plotting on continuous rolls of paper, suitable for long drawings.
IL
D. Size Limitation: Can handle longer lengths of paper than flatbed plotters.
The aspect ratio of a display screen is the ratio of its width to its height. It is typically expressed
as two numbers separated by a colon (e.g., 16:9). The aspect ratio is important for ensuring that
images and videos are displayed correctly without distortion.
Bresenham’s algorithm is better than the Digital Differential Analyzer (DDA) algorithm because:
Reflection in computer graphics is the transformation that produces a mirror image of an object
relative to a specific line (in 2D) or plane (in 3D). It involves flipping the object over the line or
plane, creating a symmetric image.
2D line clipping is the process of removing portions of lines that lie outside a specified
rectangular area (the clipping window). Algorithms such as Cohen-Sutherland, Liang-Barsky, and
Cyrus-Beck are used to determine which parts of the line are inside the clipping window and
should be displayed.
IL
The steps required to perform 3D viewing transformations include:
Parallel projections are a type of projection where the lines of sight from the object to the
projection plane are parallel to each other. They maintain the relative proportions of objects but
do not provide a realistic sense of depth. Types of parallel projections include orthographic
projection and oblique projection.
SA
j) Discuss any area filling techniques.
Area filling techniques are used to fill the interior of polygons with colors or patterns. Some
common techniques include:
I. Flood Fill: Starts from a seed point inside the area and spreads outwards until it
encounters the boundary of the area. There are two main types:
A. 4-connected: Fills in four directions (up, down, left, right).
B. 8-connected: Fills in eight directions (up, down, left, right, and diagonals).
II. Boundary Fill: Similar to flood fill but fills until it reaches a specified boundary color.
III. Scan-Line Fill: Processes each horizontal line (scan-line) of the polygon, determining
which segments of the line are inside the polygon and filling them.
IV. Seed Fill: Also known as flood fill; starts from a seed point and fills connected pixels until
the boundary is reached.
21
SECTION-B
4) What are random scan displays? Compare and contrast raster scan and random scan
displays.
IL
SECTION B (ANSWERS)
Printers are devices used to produce hard copies of digital documents or images. They can be
categorized into several types based on their printing technology:
I. Inkjet Printers:
H
A. Technology: Spray tiny droplets of ink onto paper.
B. Advantages: High-quality color printing, relatively low cost.
C. Disadvantages: Slower printing speed, higher cost per page compared to laser
printers.
SA
II. Laser Printers:
A. Technology: Use laser beams to draw images on a drum, toner (powdered ink) is
then fused onto paper.
B. Advantages: Fast printing speed, high-quality text and graphics, lower cost per
page compared to inkjet.
C. Disadvantages: Higher initial cost, generally larger and heavier.
III. Dot Matrix Printers:
A. Technology: Use a print head with pins that strike an inked ribbon to form
characters.
B. Advantages: Suitable for carbon copy printing, low cost per page.
C. Disadvantages: Noisy operation, low print quality compared to inkjet and laser
printers.
IV. Thermal Printers:
A. Technology: Use heat to transfer color dye or ink onto paper.
B. Advantages: Silent operation, fast printing speed, low maintenance.
C. Disadvantages: Limited color reproduction, can be expensive per page.
V. 3D Printers:
A. Technology: Build objects layer by layer using materials like plastic, metal, or resin.
22
B. Advantages: Can create complex 3D shapes, used in prototyping and
manufacturing.
C. Disadvantages: Limited materials and resolution, can be slow for large objects.
VI. Plotter Printers:
A. Technology: Used for printing vector graphics, such as architectural drawings or
engineering designs.
B. Advantages: High precision and accuracy for large-format printing.
C. Disadvantages: Expensive, limited to specific types of printing tasks.
Flat panel displays refer to a class of displays that are thin and use technologies such as LCD
(Liquid Crystal Display), LED (Light Emitting Diode), or OLED (Organic Light Emitting Diode).
IL
These displays are commonly used in televisions, computer monitors, and handheld devices.
III.
H
A. Technology: Use an array of LEDs as backlighting for LCD panels.
B. Advantages: Better contrast, thinner than traditional LCDs, energy-efficient.
C. Disadvantages: Can still suffer from limited viewing angles, higher cost.
OLED (Organic Light Emitting Diode):
A. Technology: Each pixel emits its own light when an electric current is applied.
B. Advantages: Excellent contrast ratio, faster response time, flexible and thinner
displays possible.
SA
C. Disadvantages: Expensive, susceptible to burn-in (though less than plasma
displays).
4) What are random scan displays? Compare and contrast raster scan and random scan
displays.
I. Memory Usage: Raster scan uses more memory due to the frame buffer, while random
scan is more memory-efficient.
II. Speed: Random scan can potentially be faster for drawing complex images due to direct
addressing, while raster scan is limited by the scanning speed.
III. Cost: Random scan displays tend to be more expensive due to the complexity of the
technology, whereas raster scan displays are more cost-effective.
The midpoint circle generation algorithm is used to draw a circle on a raster screen. It is more
efficient than other algorithms like the naive approach or the Bresenham's algorithm for circles.
IL
Here's how it works:
I. Algorithm:
A. Begin with the circle centered at (0, r) with radius r.
B. Calculate the initial decision parameter P=1−rP = 1 - rP=1−r.
C. At each step, determine the next pixel position based on the current decision
parameter:
1. If P<0P < 0P<0, move in the horizontal direction.
2. If P≥0P \geq 0P≥0, move diagonally.
II.
H
Example: Suppose we want to draw a circle with radius r = 5.
A. Initialization: Start at (0, 5).
B. Iteration Steps:
1. Calculate P=1−r=1−5=−4P = 1 - r = 1 - 5 = -4P=1−r=1−5=−4.
2. Depending on the value of P, move to the next pixel position.
3. Update PPP based on the chosen path.
SA
C. Continue iterating until the circle is complete.
Projection in computer graphics refers to the process of transforming 3D points onto a 2D plane
for display or rendering. It simulates how a 3D scene is projected onto a 2D surface, such as a
computer screen or a piece of paper.
1. One-Point Perspective:
○ Description: Objects appear smaller as they move farther away from the viewer. All
lines converge to a single vanishing point on the horizon.
○ Application: Often used in architectural drawings and urban planning.
2. Two-Point Perspective:
IL
○ Description: Similar to one-point perspective but with two vanishing points on the
horizon line, each for the horizontal lines of the object.
○ Application: Commonly used in interior design and cityscape drawings.
3. Three-Point Perspective:
○ Description: Includes a third vanishing point not on the horizon line, typically used
for objects viewed from extreme angles.
○ Application: Useful for dramatic and dynamic compositions in art and animation.
H
Perspective projection involves transforming the 3D coordinates of objects into 2D coordinates
that take into account perspective effects, such as foreshortening and depth perception, to create
a realistic representation of a 3D scene on a 2D surface.
SA
25
1. Answer briefly :
IL
d) What is function of lookup table?
h) Define shearing.
H
i) Discuss about graphic tablets.
SECTION A (ANSWERS)
1) Answer briefly:
SA
a) Give the introduction of passive graphics.
Passive graphics refers to a type of computer graphics system where the display device does not
have its own internal processor. Instead, it relies on the main computer's CPU for all processing
tasks, including generating and refreshing the display. This approach contrasts with active
graphics systems, where the display device has its own processor (such as in modern GPUs) to
handle graphics rendering independently.
Random Scan display is a type of display technology where the electron beam directly draws the
image on the screen point by point, following the commands sent by the computer's display
processor. It does not scan the entire screen sequentially like raster scan displays but rather
scans only the areas where changes occur. This method allows for more efficient use of display
memory and is capable of producing smoother, continuous lines compared to raster scan
displays.
26
c) What are flat panel devices?
Flat panel devices refer to display technologies that are thin and flat, as opposed to traditional
cathode ray tube (CRT) displays. Common types include:
These displays are widely used in modern televisions, computer monitors, laptops, tablets, and
smartphones due to their space-saving design and energy efficiency.
IL
A lookup table (LUT) is a mechanism used in computer graphics to transform input data into
output values according to a predefined set of rules or mapping. In graphics, it is commonly used
for color correction, grayscale conversion, gamma correction, and various other transformations.
It allows for efficient processing by replacing complex calculations with simple table lookups.
Flood fill techniques are used in computer graphics to fill closed areas of an image with color or
H
pattern. The basic idea is to start from a seed point (a specified starting point inside the area to
be filled) and recursively fill neighboring pixels that have the same color or meet specific criteria
until the entire area is filled. Common flood fill algorithms include:
The Sutherland algorithm, specifically the Sutherland-Hodgman clipping algorithm, is used for
polygon clipping against a rectangular clipping window. It determines which parts of the polygon
lie inside the window and outputs the clipped polygon. This algorithm is crucial in computer
graphics for ensuring that only the visible parts of objects are displayed on the screen, improving
rendering efficiency and visual clarity.
Shearing is a transformation in computer graphics that distorts the shape of an object along an
axis. It displaces each point in the object by an amount proportional to its distance from an axis
or plane. Shearing is commonly used to create 3D effects, simulate slanted shapes, or perform
transformations that tilt or skew objects.
Graphic tablets, also known as digitizing tablets or pen tablets, are input devices used to create
digital drawings and graphics. They consist of a flat surface (tablet) and a stylus (pen) that allows
users to draw directly on the tablet. The tablet detects the position of the stylus and sends this
information to the computer, where it can be used in graphic design, digital art, handwriting
IL
recognition, and other applications requiring precise input.
Color models, also known as color spaces, define how colors are represented and manipulated
in computer graphics and imaging. Common color models include:
I. RGB (Red, Green, Blue): Uses additive color mixing to create colors by combining varying
intensities of red, green, and blue light.
II.
III.
H
CMYK (Cyan, Magenta, Yellow, Key/Black): Used in printing, where colors are created
by subtractive color mixing using ink.
HSV (Hue, Saturation, Value): Represents colors based on their perceptual attributes of
hue (color), saturation (purity), and value (brightness).
IV. HSL (Hue, Saturation, Lightness): Similar to HSV but uses lightness instead of value.
These color models provide different ways to represent and manipulate colors, each suited for
SA
specific applications in computer graphics, photography, printing, and digital imaging.
SECTION-B
6. Describe the 2-D transformation matrix for rotation about arbitrary point.
7. What are different types of projections in computer graphics? Explain with example.
28
SECTION B (ANSWERS)
Function of Image Scanning in Graphics: Image scanning in graphics refers to the process of
converting a physical image or document into a digital format. This is essential for computer
processing, manipulation, storage, and display of images. The main functions include:
IL
IV. Manipulation: Editing images through operations like scaling, cropping, or applying filters.
V. Analysis: Analyzing image data for various applications, such as medical imaging, remote
sensing, or computer vision.
III.
H
Quadratic Graphs: Represented by equations of the form y=ax2+bx+cy = ax^2 + bx +
cy=ax2+bx+c. These describe parabolic curves in 2D or quadratic surfaces in 3D.
Cubic Graphs: Represented by equations involving cubic polynomials. They describe
more complex curves and surfaces.
IV. Parametric Graphs: Defined by parametric equations x=f(u)x = f(u)x=f(u) and y=g(u)y =
g(u)y=g(u), where uuu is a parameter. These are used to describe curves and surfaces by
SA
varying the parameter.
V. Implicit Graphs: Defined by equations like f(x,y)=0f(x, y) = 0f(x,y)=0. These describe
curves or surfaces implicitly defined by a relationship between variables.
VI. Explicit Graphs: Defined explicitly as y=f(x)y = f(x)y=f(x), where xxx and yyy are directly
related by a function. These are used for simpler curves and surfaces.
Bresenham's line drawing algorithm is used to draw a line between two points in a raster grid. It
is efficient because it only uses integer arithmetic and avoids floating-point calculations.
Derivation: Bresenham's algorithm optimizes the drawing of lines by choosing the next pixel
closest to the ideal line path based on the current decision parameter PPP. It ensures that the
line drawn is as close as possible to the true line, using only integer operations.
4) :->
IL
1. Start plotting points from the top of the circle (0,r)(0, r)(0,r).
2. Calculate the initial decision parameter P=1−rP = 1 - rP=1−r.
3. At each step, decide the next pixel position based on PPP:
○ If P<0P < 0P<0, move horizontally.
○ If P≥0P \geq 0P≥0, move diagonally.
4. Update PPP accordingly and continue until reaching the starting point.
H
b) With suitable examples, explain all 3D transformations.
Example:
I. Translation: Move a cube along the x-axis by tx=2t_x = 2tx=2, y-axis by ty=−1t_y =
-1ty=−1, and z-axis by tz=3t_z = 3tz=3.
II. Scaling: Enlarge a sphere by scaling factors sx=1.5s_x = 1.5sx=1.5, sy=1.5s_y =
1.5sy=1.5, and sz=1.5s_z = 1.5sz=1.5.
III. Rotation: Rotate a pyramid 45 degrees around the y-axis.
These transformations are represented using matrices and applied sequentially to transform
vertices of objects in 3D computer graphics.
Clipping in Graphics: Clipping is used in computer graphics to ensure that only the portions of
objects or images that are visible within a specified region (such as a window or viewport) are
30
displayed. It improves rendering efficiency and eliminates unnecessary calculations for invisible
parts of objects.
Text Clipping: Text clipping specifically deals with ensuring that only the visible portions of text
(characters or strings) are displayed on the screen or within a defined area. It involves checking
whether each character or part of text lies within the clipping region defined by a window or
viewport. Various algorithms, such as Cohen-Sutherland or Sutherland-Hodgman, are used for
text clipping based on the application requirements and performance considerations.
6) Describe the 2-D transformation matrix for rotation about an arbitrary point.
Rotation about an arbitrary point in 2D involves translating the rotation center to the origin,
applying rotation, and then translating back. Let (x,y)(x, y)(x,y) be the point to be rotated around a
IL
pivot point (xc,yc)(x_c, y_c)(xc,yc) by angle θ\thetaθ:
The combined transformation matrix for rotation around an arbitrary point (xc,yc)(x_c, y_c)(xc,yc)
by angle θ\thetaθ is:
SA
[cos(θ)−sin(θ)(1−cos(θ))⋅xc+sin(θ)⋅ycsin(θ)cos(θ)−sin(θ)⋅xc+(1−cos(θ))⋅yc001]\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & (1-\cos(\theta)) \cdot x_c + \sin(\theta) \cdot y_c \\ \sin(\theta) &
\cos(\theta) & -\sin(\theta) \cdot x_c + (1-\cos(\theta)) \cdot y_c \\ 0 & 0 & 1
\end{bmatrix}cos(θ)sin(θ)0−sin(θ)cos(θ)0(1−cos(θ))⋅xc+sin(θ)⋅yc−sin(θ)⋅xc+(1−cos(θ))⋅yc1
7) What are different types of projections in computer graphics? Explain with example.
Types of Projections:
1. Orthographic Projection:
○ Parallel lines remain parallel after projection. It is commonly used in engineering and
architectural drawings where maintaining accurate dimensions is crucial.
○ Example: Top-down view of a building plan.
2. Perspective Projection:
○ Emulates the way human eyes see objects in space, where objects farther away
appear smaller.
○ Example: Three-point perspective drawing of a cityscape.
31
3. Oblique Projection:
○ Combines orthographic and perspective projections to show more depth than
orthographic and more realism than pure perspective.
○ Example: Cabinet projection used in technical drawings of furniture.
Each type of projection has its application in different fields, depending on the need for accurate
representation of spatial relationships or realistic visual effects in computer graphics and
visualisation.
😀😀
IL
BY : SAHIL RAUNIYAR / PTU-CODER !
H
SA