CG 4th Sem
CG 4th Sem
Computer Graphics (CG) refers to the technology of creating, manipulating, and displaying
visual content on digital devices. It encompasses 2D and 3D graphics, animations, simulations,
and virtual environments. The field has evolved from simple vector displays in the 1950s to
highly realistic real-time rendering in gaming and film.
4. Scientific Visualization
o CG helps in creating charts, graphs, and dashboards for financial and statistical
analysis.
1. Input Devices
2. Processing Unit
Graphics Processing Unit (GPU) – Specialized for rendering images and videos
e iciently.
Framebu er – A dedicated memory area where the image is stored before being
displayed.
3. Output Devices
Printers & Plotters – Used for physical representation of digital images (e.g.,
architectural blueprints).
4. Software
Display Devices
Two types: Refresh CRT (redrawn continuously) and Color CRT (uses RGB phosphors).
Low power consumption, thin, and widely used in laptops, smartphones, and TVs.
Two types: Passive matrix (older, slower) and Active matrix (TFT-LCD, faster, better
quality).
Graphics Systems
1. Raster-Scan System
Graphic Software
1. System Software
o APIs – OpenGL, DirectX, Vulkan for rendering and interfacing with GPUs.
2. Application Software
Input/Output Devices
Input Devices
Output Devices
UNIT 2
Output Primitives
Output primitives are the basic elements used to construct graphical images, including points,
lines, circles, and curves.
Points are the smallest graphical unit, represented by pixel coordinates (x, y).
Lines are a set of points connected in a straight path between two endpoints.
A line between two points (x1,y1)(x_1, y_1)(x1,y1) and (x2,y2)(x_2, y_2)(x2,y2) can be represented
as:
y=mx+cy = mx + cy=mx+c
Steps:
Advantages:
Simple and easy to implement.
Disadvantages:
Steps:
o If p<0p < 0p<0, increment xxx and keep yyy unchanged. Update ppp using:
p=p+2Δyp = p + 2\Delta yp=p+2Δy
o If p≥0p \geq 0p≥0, increment both xxx and yyy. Update ppp using: p=p+2Δy−2Δxp
= p + 2\Delta y - 2\Delta xp=p+2Δy−2Δx
Advantages:
Steps:
4. If p<0p < 0p<0, choose the pixel directly to the right; otherwise, move diagonally.
Advantages:
Steps:
Advantages:
Properties:
Bezier Curves
where PiP_iPi are control points and Bin(t)B_i^n(t)Bin(t) are Bernstein polynomials:
Properties:
Applications:
UNIT 3
2D Transformation
2D transformations modify the position, size, and orientation of objects in a 2D plane. They are
often represented using homogeneous coordinates, which simplify matrix operations.
Adds an extra dimension (from (x, y) to (x, y, 1)) to enable matrix multiplication for
transformations.
Composite Transformation
Clipping Operations
o Mid-Point Subdivision Method: Recursively divides a line until it lies within the
clipping region.
2. Polygon Clipping
3. Text Clipping
UNIT 4
3D Graphics
3D Object Representations
3D Transformations
Projections
1. Back Face Removal – Eliminates faces facing away from the viewer.
2. Depth Bu er (Z-bu er) Algorithm – Stores depth values for each pixel to determine
visibility.
3. Scan-line Algorithm – Processes one scan line at a time, determining visible surfaces.
4. Depth Sort Algorithm (Painter’s Algorithm) – Sorts surfaces by depth and renders from
back to front.
Shading
4o