CCCS325 01 Introduction
CCCS325 01 Introduction
Introduction
1
Dr. Usman Saeed
Course objectives
After successful completion of the course:
• Students will have an understanding of fundamentals of
computer graphics
• Knowledge of programming language for computer graphics
• Students will be able to perform 2D/3D geometric
transformations
• Students will have an understanding of contemporary
graphics pipeline and the function of each stage
• Understanding of basic image processing and computer
vision concepts required for computer graphics
Computer Graphics
Book
• Fundamentals of Computer
Graphics: International Student
Edition 5th Edition
• Steve Marschner (Author), Peter
Shirley.
• CRC Press.
• September 30, 2021
• ISBN-10 : 0367505037
• ISBN-13 : 978-0367505035
3
Dr Usman Saeed
Grading
Percentage
Assessment timing of Total
Assessment
(in week no) Assessment
Score
Quiz 4,12 10%
Mid Exam 8 25%
Assignment 5,13 10%
Lab 3,6,10,13
Assignment 10%
s
Lab Project 8-15 10%
Final Exam 16 35%
What is Computer
Graphics?
• Computer graphics generally means creation,
storage and manipulation of models and images
• Such models come from diverse and expanding set
of fields including physical, biological,
mathematical, artistic, and conceptual/abstract
structures
6
Computer Graphics
• Rendering: is a term
inherited from art and
deals with the creation
of shaded images from
3D computer models.
7
Computer Graphics
• Animation: is a
technique to create an
illusion of motion
through sequences of
images.
8
Computer Graphics areas
• User interaction deals with the interface between
input devices such as mice and tablets, the
application, feedback to the user in imagery, and
other sensory feedback.
9
Computer Graphics
10
Dr Usman Saeed
Computer Graphics
11
Dr Usman Saeed
Computer Graphics
12
Dr Usman Saeed
Computer Graphics
13
Dr Usman Saeed
Computer Graphics
14
Dr Usman Saeed
Major Applications
• Video games: increasingly use sophisticated 3D models and rendering algorithms.
• Visual effects: Almost every modern film uses digital compositing to superimpose
backgrounds with separately filmed foregrounds.
• Animated films: use many of the same techniques that are used for visual effects,
but without necessarily aiming for images that look real.
Computer Graphics
Major Applications
• CAD/CAM: stands for computer-aided design and computer-aided
manufacturing.
• Simulation: can be thought of as accurate video gaming.
16
Dr Usman Saeed
Computer Graphics
Major Applications
• Medical imaging: creates meaningful images of scanned patient data.
• Information visualization: creates images of data that do not necessarily have a
“natural” visual depiction.
17
Dr Usman Saeed
Graphics APIs
• Application Program Interface (API): is a standard collection of
functions to perform a set of related operations,
• A Graphics API is a set of functions that perform basic operations
such as drawing images and 3D surfaces into windows on the
screen.
• Examples: OpenGL™, DirectX™, Windows Presentation
Foundation™ (WPF), RenderMan™, HTML5 + WebGL™
• Primitives (characters, lines, polygons, meshes,…)
• Attributes
• Color, line style, material properties for 3D
18
• Lights
• Transformations
Efficiency
A reasonable approach to making code fast is to proceed in the
following order, taking only those steps which are needed:
• Write the code in the most straightforward way possible. Compute
intermediate results as needed on the fly rather than storing
them.
• Compile in optimized mode.
• Use whatever profiling tools exist to find critical bottlenecks.
• Examine data structures to look for ways to improve locality. If
possible, make data unit sizes match the cache/page size on the19
target architecture.
• If profiling reveals bottlenecks in numeric computations, examine
the assembly code generated by the compiler for missed
efficiencies. Rewrite source code to solve any problems you find.
Designing and Coding
Graphics Programs
• Class Design
• Vector2: A 2D vector class that stores an x- and y-component.
• Vector3: A 3D vector class analogous to vector2.
• Hvector: A homogeneous vector with four components
• RGB: An RGB color that stores three components.
• Transform: A 4 × 4 matrix for transformations.
• Image: A 2D array of RGB pixels with an output operation.
• Float vs. Double: keeping memory use down and maintaining coherent
memory access are the keys to efficiency. This suggests using single-
precision data. However, avoiding numerical problems suggests using20
double- precision arithmetic.
• Debugging Graphics Programs
• Images as Coded Debugging Output
• Using a Debugger