Computer Graphics (CS801D)
MODULE-1
What is Computer Graphics?
Computer graphics is the science and art of creating, manipulating and
displaying visual content using computers.
Computer graphics is an art of drawing pictures, lines, charts, etc using
computers with the help of programming. Computer graphics is made
up of a number of pixels. Pixel is the smallest graphical picture or unit
represented on the computer screen.
Objective of Computer Graphics:
Graphical User Interfaces (GUIs): Developing user-friendly interfaces
with icons and menus that allow users to interact with digital devices
effectively.
Visualization of Data: Representing complex, abstract, or large
datasets (e.g., scientific or financial data) as charts, graphs, and 3D
models to make them easier to analyze.
Image Generation and Rendering: Creating realistic or artistic images
from mathematical models, using techniques like ray tracing to simulate
light.
Interactive Manipulation: Enabling real-time user interaction with
graphical objects, such as in CAD (Computer-Aided Design) for
engineering or GUI (Graphical User Interface) design.
Simulation and Training: Creating realistic virtual environments for
training, such as flight simulators, to provide safe and effective,
immersive, or high-fidelity training experiences.
Animation and Entertainment: Producing visual content for films,
television, and video games.
Application of Computer Graphics
Computer-Aided Design: Used for engineering and architectural
systems etc. Objects may be displayed in a wireframe outline form.
Multi-window environment is also favored for producing various
zooming scales and views. Animations are useful for testing
performance.
Presentation Graphics: To produce illustrations which summarize
various kinds of data. Except 2D, 3D graphics are good tools for
reporting more complex data.
Computer Art: Painting packages are available. With cordless,
pressure-sensitive stylus, artists can produce electronic paintings which
simulate different brush strokes, brush widths, and colors.
Photorealistic techniques, morphing and animations are very useful in
commercial art. For films, 24 frames per second are required. For video
monitor, 30 frames per second are required.
Entertainment: Motion pictures, Music videos, and TV shows,
Computer games.
Education and Training: Training with computer-generated models of
specialized systems such as the training of ship captains and aircraft
pilots.
Visualization: For analyzing scientific, engineering, medical and
business data or behavior. Converting data to visual form can help to
understand mass volume of data very efficiently.
Image Processing: Image processing is to apply techniques to modify
or interpret existing pictures. It is widely used in medical applications.
Graphical User Interface: Multiple window, icons, menus allow a
computer setup to be utilized more efficiently.
GKS (Graphical Kernel System) in Computer Graphics:
Definition
The GKS (Graphical Kernel System) is a standard graphics programming
interface (API) defined by ISO for creating device-independent 2D
graphics. It provides a set of functions that allow applications to produce
graphical output on different devices without changing the program.
Key Features
Device independence
Standardized graphics functions
Supports multiple input/output devices
Mainly focused on 2D graphics
Applications of GKS
1. Computer-Aided Design (CAD): Used in basic drafting and design tools.
2. Scientific Visualization: Graph plotting, charts, engineering analysis.
3. Business Graphics: Pie charts, bar graphs, reports.
4. Simulation Systems: Simple simulations in education and training.
5. Educational Software: Teaching basic computer graphics concepts.
Step-by-Step Working Process
1. Application Program
The user writes a program using GKS functions.
Example: draw line, display text, fill shapes. As per example: polyline(), text(),
fill_area()
2. GKS Function Calls
These functions act as an interface (API).
They are device-independent, meaning the same code works for different devices.
3. GKS Kernel (Core System)
The central part of GKS.
Responsibilities:
o Interprets graphics commands
o Manages graphics state (color, line style, etc.)
o Transforms coordinates (world → device coordinates)
4. Workstation Driver
Converts GKS commands into device-specific instructions.
Each output device has its own driver.
Example: Monitor driver, Printer driver
5. Output Devices
Final graphical output is displayed.
Examples:
o Screen (CRT/LCD)
o Plotter
o Printer
6. Input Handling (Reverse Flow)
GKS also supports input devices:
o Keyboard
o Mouse (locator)
Input is processed and sent back to the application.
PHIGS (Programmer’s Hierarchical Interactive Graphics System)
Definition
The PHIGS (Programmer's Hierarchical Interactive Graphics System) is a
standard graphics programming system (API) used for creating and managing
interactive 3D graphics with support for hierarchical structures.
PHIGS allows programmers to:
Create complex graphical objects using a hierarchical (tree-like)
structure
Support 3D transformations such as translation, rotation, and
scaling
Handle interactive graphics efficiently
Manage and reuse graphical components through structured storage.
Key Features
Supports 3D primitives.
Uses hierarchical structure (tree-like) for objects.
Allows transformations (rotate, scale, translate).
Supports hidden surface removal and viewing operations.
Working Process of PHIGS
1. Application Program
User writes a program using PHIGS functions.
Defines graphical objects and their relationships.
2. PHIGS API
Provides functions for:
o Creating structures
o Editing structures
o Applying transformations
3. Structure Store (Core Concept)
Stores all graphical objects in a hierarchical tree form.
Each structure can contain:
o Primitives (lines, polygons)
o References to other structures
Example hierarchy:
Car :
a) Body
b) Wheel
c) Window
4. PHIGS Central System
Processes structure data.
Performs:
o Viewing transformations
o Clipping
o Hidden surface removal
5. Workstation Driver
Converts processed data into device-specific instructions.
6. Output Device
Displays the final 3D scene on screen.
7. Input Handling
Accepts interactive input:
o Mouse (picking objects)
o Keyboard
Allows modification of structures dynamically.
Applications of PHIGS
1. Computer-Aided Design (CAD)
Used for designing mechanical parts, buildings, and circuits.
Hierarchical structure helps manage complex designs (e.g., machine → parts →
components).
2. Engineering and Scientific Visualization
Used to visualize:
o 3D graphs
o Fluid dynamics
o Structural analysis
Helps in better understanding of complex data.
3. Simulation Systems
Flight simulators, driving simulators, and training systems.
Real-time interaction and object manipulation are supported.
4. Animation and Modeling
Creation of animated 3D objects and scenes.
Hierarchical modeling simplifies animation (e.g., human body movement).
5. Virtual Reality (VR) and Interactive Systems
Used in immersive environments where objects are manipulated interactively.
6. Geographic Information Systems (GIS)
3D terrain modeling and map visualization.
7. Medical Imaging
Visualization of organs, CT scans, and 3D anatomical models.
8. Defense and Aerospace Applications
Radar simulation, aircraft design, and mission planning systems.
Feature GKS PHIGS
Graphics Type 2D 3D
Structure Non-hierarchical Hierarchical (tree structure)
Complexity Simple Advanced
Transformation Limited Extensive
Application Basic graphics CAD, Simulation
Normalized Coordinate System (NCS) in Computer Graphics
Definition :
The Normalized Coordinate System (NCS) is a coordinate system in which
all graphical objects are mapped into a standard range, typically from 0 to 1
along both x and y axes (and z in 3D), regardless of the actual screen size.
Explanation
In NCS, the display area is treated as a unit square (2D) or unit cube (3D).
Coordinates are scaled such that:
o Left-bottom corner → (0, 0)
o Right-top corner → (1, 1)
Example
If a window in world coordinates is:
(Xmin, Ymin) = (100, 100)
(Xmax, Ymax) = (500, 500)
A point (300, 300) is converted to NCS as:
So, normalized point = (0.5, 0.5)
Key Features
Device-independent representation
Standard range (0 to 1)
Simplifies clipping and transformations
Used in systems like GKS (Graphical Kernel System)
Working Process
1. World Coordinate System (WCS) : Objects are defined in real-world
coordinates.
2. Normalization Transformation: Coordinates are scaled and translated
into the range [0,1].
3. Device Coordinate System (DCS): Normalized coordinates are mapped to
actual device resolution (pixels).
Definition of Pixel :
A pixel (short for “picture element”) is the smallest unit of a digital image
or display screen that can be individually controlled and displayed.
Explanation
A digital image is made up of a grid of tiny squares, called pixels.
Each pixel holds color and intensity information.
When many pixels are combined, they form a complete image.
Example
A screen resolution of 1920 × 1080 means:
o 1920 pixels horizontally
o 1080 pixels vertically
Total pixels = 2,073,600 pixels
Key Characteristics
Smallest addressable unit on a display
Stores color values (RGB)
Determines image clarity (resolution)
Pixel vs. Resolution
More pixels → Higher resolution → Clearer image
Fewer pixels → Lower resolution → Blurry image
Definition of Resolution :
Definition
Resolution refers to the total number of pixels displayed on a screen or
contained in an image, usually expressed as width × height.
Explanation
A digital image or display is made up of tiny units called pixels.
Resolution tells us how many pixels are used to form the image.
Higher resolution means more detail and clarity.
Example
800 × 600 → Low resolution
1920 × 1080 (Full HD) → High resolution
3840 × 2160 (4K) → Very high resolution
Types of Resolution
1. Screen Resolution
Number of pixels on a display screen
Example: 1366 × 768, 1920 × 1080
2. Image Resolution
Total pixels in a digital image
3. Print Resolution
Measured in DPI (Dots Per Inch)
Higher DPI → Better print quality
Aspect Ratio:
It defines the shape of the image, not its size.
Aspect ratio is the ratio of the width to the height of an image, screen,
or display.
Example 1:
Resolution = 1920 X 1080
1920/1080=16/9
Aspect ratio = 16:9
Example 2:
Resolution = 1024 × 768
1024/768=4/3
Aspect ratio = 4:3
Why Aspect Ratio is Important
Maintains correct image shape
Prevents distortion (stretching/squeezing)
Important in video, gaming, and graphics design