This course includes:
(updated Jan 2021)

35 hours of ondemand video

Downloadable resources and exercises

Full lifetime access

Access on mobile and desktop

14day money back guarantee

Certificate of completion

Secure checkout through Credit Card or PayPal
Is this course for you?
Prerequisites
Before taking this course, you must have:

A basic understanding of programming fundamentals, such as variables, conditionals, loops, and functions.

Some familiarity with the commandline on either Linux, Windows, or macOS.
Technologies we'll use and learn
We will learn how to represent and display 3D objects without any graphics API.
No OpenGL. No DirectX. No GPU... Just you, a C compiler, a smoking processor, lots of linear algebra, and an array of pixels willing to dance 90's style.
We'll use the C programming language and a library called SDL to gain access and poke the pixels of our display.
What you'll learn
Here are the topics you'll learn in this course

C programming language & SDL

Rasterization of lines and triangles

Render flatshading and textured 3D meshes

Linear algebra and the mathematics of computer graphics

Load and render external OBJ files

Projection, light, shading, and camera

Texture mapping

ZBuffer & 3D Clipping
Focus on the fundamentals
Projectbased learning
Course Content

2
Dependencies and Folder Structure
 Installing Dependencies FREE PREVIEW
 The Compilation Flow
 Working with Makefiles
 Configuring Visual Studio for Windows
 Configuring MinGW for Windows

3
SDL Initialization and Color Buffer
 Creating an SDL Window
 Rendering an SDL Window
 Declaring a Color Buffer
 Allocating Memory and Freeing Resources
 Checking for Errors in Memory Allocation
 Quiz: Memory Allocation
 The Operator Sizeof
 SDL Texture
 Fullscreen Window
 Exercise: Drawing a Background Grid
 Drawing a Background Grid
 Background Color Patterns
 Exercise: Drawing Rectangles
 Creating a Function to Draw Rectangles
 Quiz: Color Buffer

4
Multiple Header Files
 Defining Header Files
 Coding New Header Files

5
Vectors and Points
 The Draw Pixel Function
 Vectors
 Declaring a Vector Type
 Review of C Structs
 Array of Points
 Constant Array Size Declaration

6
Projecting Points
 Orthographic Projection
 Isometric Projection
 Perspective Projection
 Implementing the Perspective Divide
 Coordinate System Handedness

7
Linear Transformations
 Vector Transformations
 Review of Sine Cosine and Tangent
 Trigonometric Functions Quiz
 Rotating Vectors
 Vector Rotation Function
 Proof of Angle Sine Addition
 Exercise: Proving the Angle Cosine Addition
 Proof of Angle Cosine Addition

8
Fixed Game Loop
 Fixing our Game Loop Time Step
 Using a Delay Function
 Capped Framerate & Delta time

9
Triangles and Vertices
 Triangles and Meshes
 Vertices and Triangle Faces
 Triangle Edges

10
Line Drawing
 Line Equation
 DDA Line Drawing Algorithm
 Coding a Function to Draw Lines

11
Dynamic Arrays
 Dynamic Arrays
 Dynamic Mesh Vertices and Faces
 Separation of Vertex and Faces

12
OBJ Files
 OBJ Files
 Exercise: Loading OBJ File Content
 Loading OBJ File Content
 OBJ Files as Quads or Triangles

13
Vector Operations
 Backface Culling Motivation
 Backface Culling in Games
 Vector Magnitude
 Vector Addition and Subtraction
 Vector Scalar Multiplication and Division
 Vector Cross Product
 Finding the Normal Vector
 Dot Product
 Backface Culling Algorithm
 Backface Culling Code
 Vector Normalization

14
Triangle Rasterization
 Triangle Fill
 FlatBottom & FlatTop Technique
 Activity: Find Triangle Midpoint
 Solution to the Triangle Midpoint
 Coding the Triangle Midpoint Computation
 FlatBottom Triangle Algorithm
 FlatBottom Triangle Code
 FlatTop Triangle Algorithm
 FlatTop Triangle Code
 Avoiding Division by Zero
 Exercise: Selecting Different Render Modes
 Different Rendering Options Solution
 Compiler Error & Enum Declaration
 Typedef for Color Values
 Colored Triangle Faces

15
Sorting Faces by Depth
 Painter's Algorithm
 Exercise: Sorting Faces
 Coding a Sorting Function

16
Matrices
 Matrices Overview
 Matrix Operations
 Properties of Matrix Multiplication
 Examples of Matrix Multiplication
 Exercise: Matrix Multiplication
 2D Rotation Matrix

17
3D Matrix Transformations
 3D Matrix Transformations
 3D Scale Matrix
 Matrix Typedef
 Scale Matrix Code
 3D Translation Matrix
 Translation Matrix Code
 3D Rotation Matrices
 Rotation Matrix Code
 The World Matrix
 Order of Transformations
 Translation is Not a Linear Transformation

18
Projection Matrix
 Defining a Projection Matrix
 Coding the Perspective Projection Matrix
 Perspective Projection Matrix Review
 Normalized Device Coordinates
 Projection in OpenGL
 Rowmajor and Columnmajor Orders
 Order of Transformations for Rowmajor and Columnmajor

19
Light and Shading
 Flat Shading
 Coding Flat Shading & Light
 A Note on Vector Normalization
 Smooth Shading Options
 Inverted Vertical Screen Values

20
Texture Mapping
 Texture Mapping
 Representing Textures in Memory
 Texture Typedef
 Textured Triangles
 Textured FlatBottom Triangle
 Textured FlatTop Triangle
 Barycentric Coordinates
 Barycentric Weights (α, β, γ)
 Visualizing Textured Triangles

21
Perspective Correct Interpolation
 Perspective Correct Interpolation FREE PREVIEW
 Perspective Correct Interpolation Code
 What Does "Affine" Mean?
 A Deeper Look into Perspective Correct Theory
 Inverted Cube UV Coordinates

22
Decoding PNG Files
 Decoding PNG Files
 Loading PNG File Content
 Freeing PNG Textures

23
Textured OBJ Files
 Loading OBJ Texture Attributes
 Preventing Texture Buffer Overflow
 Rasterization Rules
 Visualizing Textured OBJ Models

24
ZBuffer
 ZBuffer
 ZBuffer Code
 Exercise: ZBuffer for Filled Triangles
 Implementing a ZBuffer for Filled Triangles
 A Discussion on Dynamic Memory Allocation

25
Camera
 Camera Space
 Look At Camera Model
 Look At Transformations
 The LookAt Function
 Coding the LookAt Function
 So, What Actually Gets Transformed?
 Delta Time Factor
 A Simple FPS Camera Movement
 Coding a Simple FPS Camera Movement

26
Clipping
 Frustum Clipping
 Planes
 Exercise: Right Frustum Plane Point & Normal
 Defining Frustum Planes Points & Normals
 Initializing an Array of Frustum Planes
 Defining Points Inside and Outside Planes
 Intersection Between Line & Plane
 Clipping a Polygon Against a Plane
 Polygon Typedef
 A Function to Clip Polygon Against Planes
 Coding the Function to Clip Polygons Against Planes
 Converting Polygons Back Into Triangles
 Visualizing Clipped Triangles
 Horizontal & Vertical FOV Angles
 Clipping Texture UV Coordinates

27
Code Polishing & Refactoring
 Working with Static Variables
 Refactoring SDL Globals
 Simulating LowResolution Displays
 Refactoring Light Globals
 Exercise: Camera Pitch Rotation
 Implementing the Camera Pitch Rotation

28
Multiple Meshes
 Declaring Multiple Meshes
 Implementing Multiple Meshes
 Implementing Multiple Textures

29
Conclusion and Next Steps
 Finishing our Implementation
 Handedness and Orientation
 Dedicated Graphics Cards
 Modern Graphics APIs & Shaders
 Modern 3D Hardware Techniques
 Next Steps
 Copyright & Content Distribution
 Similar Courses
FAQ

Will this course work for any operating system?
The code we'll create will work for Linux, macOS, Windows, and even RaspberryPi.

What if I don't know anything about the C programming language?
Not a problem. Many students come from different languages (C++, Java, Python, JavaScript, Swift, etc.). A basic understanding of coding in any language is enough for you to follow along. We'll learn the details of the C language together.

What if I have any issues or questions?
Each lecture has its own discussion board, where you can interact and ask other students for help.
Instructor

Senior Lecturer
Gustavo Pezzi
Gustavo teaches computer science and mathematics at BPP University, London. He studies how teaching game programming can help enhance awareness and understanding of basic mathematics and physics. He is also a professional programmer with several years of experience in the computing industry. His academic path includes institutions such as Pittsburg State University, City University of London, and University of Oxford.