0% found this document useful (0 votes)
53 views42 pages

CG Notes

Uploaded by

rishirajsri15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views42 pages

CG Notes

Uploaded by

rishirajsri15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

UNIT I – Introduction to Computer Graphics

1. Introduction to Computer Graphics

Definition: Computer Graphics is the field of visual computing, where one utilizes computers both to generate visual images synthetically
and to integrate or alter visual and spatial information sampled from the real world.

Purpose: To display data pictorially so it can be easily understood and interpreted.

2. Advantages of Interactive Computer Graphics

Enhances user interaction with the system.

Useful in simulation, CAD, games, GUI, etc.

Provides real-time feedback and editing.


Improves decision-making through visualization.

Easier data interpretation (especially in business and scientific domains).

3. Representative Uses of Computer Graphics

Scientific Visualization – e.g., molecular structures, physics simulations.

Engineering & CAD – e.g., architectural plans, circuit designs.

Entertainment – e.g., movies, games.

Education & Training – e.g., virtual reality for pilot training.


Business – e.g., charts, presentations.

Medical Imaging – e.g., CT scans, MRIs.

Art and Design – e.g., digital painting, animations.

4. Conceptual Framework for Interactive Graphics

Input devices: Mouse, keyboard, touchscreen.

Output devices: Monitor, printers.

Graphics software: Provides drawing functions.

User: Interacts with the system through UI.


Application program: Coordinates between user input and image output.

Typical Flow:

mathematica

CopyEdit

User Input Application Program Graphics Package Display

5. Classification of Application Computer Graphics

Interactive Graphics: User can control and manipulate images (e.g., AutoCAD).

Non-Interactive Graphics: Predefined output, no user interaction during execution (e.g., film animation rendering).
6. Development of Hardware and Software for Computer Graphics

Hardware:

Display Devices: CRT, LCD, LED, OLED.

Input Devices: Mouse, light pen, digitizer, joystick.

Storage: High-speed memory and GPUs.

Processors: Specialized graphics processors (GPUs).

Software:

Graphics Libraries: OpenGL, DirectX.


Languages: C, C++, Java (often with graphics packages).

APIs: Used for rendering, shading, image processing.

Quick Objective Pointers

CRT is an example of a raster scan display.

Interactive Graphics allows real-time editing.

CAD stands for Computer-Aided Design.

OpenGL is a commonly used graphics API.


Sample Subjective Questions
1.
Define Computer Graphics and explain its advantages.

2.
Explain the conceptual framework for interactive computer graphics.

3.
Differentiate between interactive and non-interactive computer graphics.

4.
List and explain various application areas of computer graphics.

5.
Describe the evolution of hardware and software used in computer graphics.
UNIT II – Scan Conversion & Clipping

1. Scan Conversion

Definition:
The process of converting basic geometric shapes like lines, circles, and ellipses into pixels for display on raster screens.

a. Scan Converting Lines

Bresenham’s Line Algorithm:

Efficient, incremental algorithm to draw lines.

Uses only integer arithmetic.


Chooses the nearest pixel to the theoretical line.

DDA (Digital Differential Analyzer) Algorithm:

Uses floating-point arithmetic.

Simpler but slower compared to Bresenham.

b. Scan Converting Circles

Midpoint Circle Algorithm:

Based on Bresenham’s logic.

Efficient and uses symmetry of circles.


Only 1/8th of the circle is computed and mirrored.

c. Scan Converting Ellipses

Midpoint Ellipse Algorithm:

Handles two regions (slope < 1 and slope > 1).

Symmetrical drawing to reduce calculations.

2. Clipping

Definition:
Clipping is the process of removing portions of lines, polygons, or images outside a designated region (called the viewport or clipping window).
a. Point Clipping

Checks whether a point lies inside the clipping window.

Simple condition:
If xmin ≤ x ≤ xmax and ymin ≤ y ≤ ymax, the point is inside.

b. Line Clipping Algorithms


1.
Cohen-Sutherland Line Clipping Algorithm

Assigns region codes to endpoints.

Fast rejection or acceptance using logical AND/OR.


Handles lines partially inside and outside.

2.
Midpoint Subdivision Algorithm

Recursive approach: divide line into halves until trivially accepted or rejected.

More accurate but computationally heavy.

c. Polygon Clipping

Sutherland–Hodgeman Polygon Clipping Algorithm:

Works by clipping polygon edges one by one against window boundaries.


Output of one edge becomes input for the next.

Quick Objective Pointers

Scan conversion turns geometric data into pixel data.

Bresenham’s algorithm is faster than DDA due to integer arithmetic.

Midpoint circle algorithm uses circle symmetry.

Cohen-Sutherland uses region codes.

Sutherland-Hodgeman is used for polygon clipping.


Sample Subjective Questions
1.
Explain the working of Bresenham’s Line Drawing Algorithm with an example.

2.
Describe the Midpoint Circle Algorithm and its steps.

3.
What is clipping? Explain Cohen-Sutherland Line Clipping Algorithm.

4.
Differentiate between Midpoint Subdivision and Cohen-Sutherland.

5.
Explain Sutherland-Hodgeman algorithm for polygon clipping.
UNIT III – Geometrical Transformation

1. 2D Transformations

Transformations change the position, size, orientation, or shape of an object.

a. Basic Transformations
1.
Translation:
Moves an object from one position to another.

bash

CopyEdit

x' = x + tx, y' = y + ty


2.
Scaling:
Enlarges or shrinks an object.

bash

CopyEdit

x' = x * sx, y' = y * sy

3.
Rotation:
Rotates an object around the origin.

arduino

CopyEdit

x' = x*cosθ - y*sinθ y' = x*sinθ + y*cosθ


4.
Reflection:
Creates a mirror image across a given axis.
Examples:

Across X-axis: (x, -y)

Across Y-axis: (-x, y)

5.
Shearing:
Slants the shape of an object.

X-Shear: x' = x + shx * y

Y-Shear: y' = y + shy * x


2. Homogeneous Coordinates

To represent all transformations using matrix multiplication.

Converts 2D point (x, y) into 3D vector (x, y, 1).

3. Matrix Representation of 2D Transformations

Each transformation can be expressed as a 3×3 matrix:

Transformation Matrix Form


Translation [10tx],[01ty],[001][1 0 tx], [0 1 ty], [0 0 1][10tx],[01ty],[001]
Scaling [sx00],[0sy0],[001][sx 0 0], [0 sy 0], [0 0 1][sx00],[0sy0],[001]
Rotation [cosθ−sinθ0],[sinθcosθ0],[001][cosθ -sinθ 0], [sinθ cosθ 0], [0 0 1][cosθ−sinθ0],[sinθcosθ0],[001]
Multiple transformations can be combined into one by matrix multiplication.

4. Successive & Composite Transformations

Combining multiple transformations (e.g., rotate + scale).

Multiply matrices in reverse order of operations.

Helps optimize and simplify computation.

5. Window-to-Viewport Transformation
Maps coordinates from world coordinate system (window) to device coordinate system (viewport).

Equation:

ini

CopyEdit

xv = (x - wxmin) * (vxmax - vxmin) / (wxmax - wxmin) + vxmin yv = (y - wymin) * (vymax - vymin) / (wymax - wymin) + vymin

Maintains the shape and aspect ratio of the image.

6. Introduction to 3D Transformations

Similar to 2D, but with an added Z-axis.


Basic 3D Transformations:

Translation: (x, y, z) (x + tx, y + ty, z + tz)

Scaling: (x * sx, y * sy, z * sz)

Rotation: About X, Y, or Z axis using 3×3 rotation matrices.

Quick Objective Pointers

Translation moves an object without rotation or resizing.

Shearing distorts shape while keeping it flat.

Homogeneous coordinates allow combining transformations.


Window-to-viewport transformation maps coordinates to screen size.

Sample Subjective Questions


1.
Define and explain 2D geometric transformations with examples.

2.
Derive the matrix for rotation and show how it is used.

3.
What is the purpose of homogeneous coordinates?

4.
Write the steps and formula for window-to-viewport transformation.

5.
Explain the concept of composite transformation with an example.
UNIT IV – Curves and Surfaces

1. Introduction to Curve Representation

Why curves?
Straight lines and polygons can’t always represent complex shapes like circles or natural curves smoothly.

Types:

Explicit: y = f(x)

Implicit: f(x, y) = 0
Parametric: x = f(t), y = g(t)

Parametric representation is most commonly used in graphics.

2. Polynomial Curves

Used to represent curves using polynomial equations.

General form:

markdown

CopyEdit

P(t) = a0 + a1*t + a2*t² + ... + an*t^n


Limitations: May oscillate wildly for high degrees (Runge's phenomenon).

3. Parametric Cubic Curves

Most common polynomial curve used in graphics.

Degree 3 polynomial:

CopyEdit

P(t) = a + bt + ct² + dt³


Controlled by 4 points (start, end, and two control points).

4. Bezier Curves

Developed by Pierre Bézier for car design.

Defined by control points (usually 4 for cubic Bezier).

Curve lies within the convex hull of control points.

Properties:

Always passes through first and last control points.


Is smooth and infinitely scalable.

Uses Bernstein polynomials.

Equation for cubic Bezier curve:

bash

CopyEdit

P(t) = (1−t)³P0 + 3t(1−t)²P1 + 3t²(1−t)P2 + t³P3, where 0 ≤ t ≤ 1

5. B-Spline Curves

Generalization of Bezier curves.


Basis spline: uses basis functions and control points.

Offers more local control than Bezier (modifying one point affects only part of the curve).

Defined using a knot vector.

Advantages:

Good for complex modeling.

Smooth, continuous, and efficient.

6. Surfaces

Created by sweeping a curve along another curve or axis.


Surface types:

Bezier Surfaces: Extension of Bezier curves to two dimensions.

B-Spline Surfaces: Uses tensor product of B-spline basis functions.

Quick Objective Pointers

Bezier curves are defined using Bernstein polynomials.

B-spline offers local control; Bezier does not.

Parametric curves use a parameter 't'.


A cubic Bezier uses 4 control points.

Sample Subjective Questions


1.
Explain the construction and properties of Bezier curves.

2.
Differentiate between Bezier and B-spline curves.

3.
Write the parametric equation of a cubic curve.

4.
Define B-spline curve and explain the role of the knot vector.

5.
How are surfaces generated from curves in graphics?
UNIT V – Multimedia Systems

1. Introduction to Multimedia

Definition:
Multimedia is the integration of multiple forms of media—text, images, audio, video, animation, and interactivity—to present information.

Characteristics:

Combines two or more media.

Usually interactive.

Computer-controlled integration.
2. Components of Multimedia
1.
Text – Basic form of information; used for titles, labels, descriptions.

2.
Graphics – Still images, drawings, photos.

3.
Audio – Speech, music, sound effects.

4.
Video – Moving images (real or recorded).

5.
Animation – Simulated motion using image sequences.

6.
Interactivity – User control and navigation.
3. Multimedia Applications

Education: e-learning platforms, interactive tutorials.

Entertainment: video games, movies, music players.

Advertising: digital billboards, promotional videos.

Training: flight simulators, medical simulations.

Business: presentations, demos, kiosks.

4. Multimedia Systems Architecture

A typical multimedia system includes:


Input Devices: Keyboard, mouse, scanner, microphone, camera.

Storage Devices: Hard disks, SSDs, CDs/DVDs.

Processing Unit: CPU and GPU.

Output Devices: Monitor, speakers, printer.

Also includes software like:

Media Players (VLC, Windows Media Player)

Authoring Tools (Flash, Director)

Editing Tools (Photoshop, Premiere Pro)


5. Multimedia File Formats

Image: JPEG, PNG, BMP, GIF

Audio: MP3, WAV, AAC

Video: MP4, AVI, MOV

Animation: SWF, GIF

Documents: PDF, DOCX


6. Multimedia Authoring Tools

These help create and integrate multimedia content.

Types:

Card- or Page-Based (e.g., HyperCard)

Icon-Based (e.g., Authorware)

Time-Based (e.g., Adobe Flash, Adobe Animate)

7. Hypermedia and Hypertext

Hypertext: Text that contains links to other text.


Hypermedia: Extension of hypertext including multimedia (images, sound, video).

Example: Websites with clickable images and videos.

Quick Objective Pointers

Multimedia = Text + Audio + Video + Animation + Graphics.

MP3 is a compressed audio format.

Hypertext = text with links; Hypermedia = multimedia with links.

SWF is an animation file format.


Sample Subjective Questions
1.
Define multimedia and explain its components.

2.
Describe the architecture of a multimedia system.

3.
Write short notes on Hypermedia and Hypertext.

4.
Explain different multimedia file formats.

5.
What are multimedia authoring tools? Describe their types.

1. Keyframe Animation
Concept: Keyframe animation involves setting specific frames, called keyframes, at certain points in time to define the starting and ending
points of a movement or transformation.

Interpolation: The computer generates intermediate frames between keyframes using techniques like linear interpolation or more advanced
methods such as spline interpolation.

2. Animation Curves

Bezier Curves: Used for smooth transitions between keyframes, defining the trajectory of an object’s movement.

Spline Curves: These provide a more refined control over the motion path compared to Bezier curves, using multiple control points.

3. Rigging and Skeleton Animation

Rigging: The process of creating a skeleton for a 3D model, which allows it to be posed or animated.

Inverse Kinematics (IK): A method for animating the skeleton by adjusting the position of the end effectors (e.g., hands, feet) and having the
system automatically calculate the necessary positions of other bones.

4. Motion Capture

Concept: Capturing the movement of real-life actors using sensors or markers and applying the data to a 3D model for realistic animations.

Applications: Often used in film and video games to produce lifelike character animations.

5. Particle Systems

Definition: Used for simulating a wide range of phenomena, such as smoke, fire, rain, or explosions. Each particle behaves according to
predefined physics rules.

Components: Emitters, particles, and forces control the behavior and appearance of the system.

6. Inverse Kinematics (IK) and Forward Kinematics (FK)


Forward Kinematics (FK): The process of determining the position of a body part (like a hand) by knowing the positions of other body parts
(like the arm).

Inverse Kinematics (IK): The reverse process of determining the positions of body parts based on the desired position of the end effector
(e.g., a hand or foot).

7. Graphical Techniques for Animation

Tweening: Automatically generating intermediate frames between two keyframes to create smooth animations.

Frame-by-Frame Animation: Involves drawing each frame individually, typically used in traditional animation or for specific effects in digital
animations.

8. 3D Animation Techniques

Mesh Deformation: The process of transforming a 3D model’s shape during animation (like bending or twisting).
Facial Animation: Techniques specifically focused on animating a character's face, used in conjunction with lip-syncing and emotional
expression.

9. Rendering Techniques

Real-time Rendering: Rendering animation frames in real time, often used in video games and simulations.

Pre-rendered Animation: Frames are rendered beforehand and stored, typical for high-quality films and CGI sequences.

10. Animation in Games

Skeletal Animation: Used in games to animate characters through a skeleton structure.

Blend Trees: A system for blending multiple animations smoothly based on input parameters (e.g., walking, running).

You might also like