This is a self-contained course with **no** prerequisites. However, you will probably get the most out of it if you already know the basics of coding (if-else, loops, functions).

If you never programmed in C before, don't worry! Many successful students come from different languages like Java, Python, JavaScript, Swift, and others. We'll learn to work with the C language together.

## Course content

1. Introduction

- Motivations & Learning Outcomes
- How to Take This Course

2. Compiling our C Project

- Configuring Dependencies
- Project Folder Structure
- Configuring a Makfile
- Compiling on Linux
- Compiling on macOS
- Configuring Visual Studio on Windows

3. SDL Window & Color Buffer

- Creating an SDL Window
- Declaring a Color Buffer
- Allocating and Freeing Memory
- Quiz: Memory Allocation
- SDL Texture
- Fullscreen Window
- Exercise: Drawing a Background
- Drawing Rectangles
- Quiz: Color Buffer

4. Header Files

- Defining Header Files
- Quiz: Header Files

5. Vectors and Points

- A Function to Draw Pixels
- Vectors
- Declaring a Vector Type
- Declaring Structs
- Array of Vector Points
- Quiz: Vectors and Points

6. Projecting Points

- Orthographic Projection
- Isometric Projection
- Perspective Projection
- Implementing the Perspective Divide
- Coordinate System Handedness
- Quiz: Perspective Projection

7. Vector Transformations

- Transforming Vectors
- Review of Sine, Cosine, and Tangent
- Quiz: Trigonometric Functions
- Rotating Vectors
- Proof of Angle Sine Addition
- Proof of Angle Cosine Addition
- Quiz: Rotating Vectors

8. Fixed Framerate

- Fixing our Game Loop Timestep
- Using a Delay Function
- Constant Framerate and Variable Delta Time

9. Triangles and Vertices

- 3D Triangles and Meshes
- Vertices and Triangle Faces
- Triangle Edges
- Quiz: Joystick Input

10. Drawing Lines

- Line Equation
- DDA Line Drawing Algorithm
- Do We Need Bresenham Lines?
- Coding a Function to Draw Lines

11. Dynamic Arrays

- Dynamic Arrays in C
- Dynamic Mesh Vertices and Faces
- Defining the Project Playfield Graphics

12. OBJ Files

- OBJ File Vertices and Faces
- Exercise: Loading OBJ File Content
- OBJ File Triangles and Quads

13. Vector Operations

- Introduction to Back-face Culling
- Vector Magnitude
- Vector Addition
- Vector Subtraction
- Vector Scaling
- Vector Cross Product
- Finding the Triangle Normal Vector
- Dot Product
- Implementing the Back-face Algorithm
- Vector Normalization
- Quiz: Vector Operations

14. Triangle Rasterization

- Triangle Fill
- Flat-Top & Flat-Bottom Technique
- Flat-Top Triangle Code
- Flat-Bottom Triangle Code
- Avoiding Division by Zero
- Exercise: Different Rendering Methods
- Solid Color Triangle Faces

15. Sorting Faces by Depth

- Painter's Algorithm
- Exercise: Sorting Faces by Depth
- A Simple Sorting Function

16. Matrices

- Matrices Review
- Matrix Operations
- Matrix Multiplication
- Exercise: Matrix Multiplication
- 2D Rotation Matrix

17. 3D Matrix Transformations

- 3D Scale Matrix
- 3D Translation Matrix
- 3D Rotation Matrices
- The World Matrix
- Order of Matrix Transformations
- Quiz: Matrix Transformations
- Translation is Not a Linear Transformation

18. Projection Matrix

- Defining a Projetion Matrix
- Populating the Perspective Projection Matrix
- Exercise: Projecting Negative Z Values
- Projection in OpenGL & DirectX
- Row-Major and Column-Major Order

19. Light and Shading

- Flat Shaded Triangles
- Coding Flat Shading and Light
- Smooth Shading
- Gouraud Shading & Phong Shading

20. Texture Mapping

- Representing Textures in Memory
- Textured Triangles
- Textured Flat-Top Triangle
- Textured Flat-Bottom Triangle
- Barycentric Coordinates
- Barycentric Weights (α, β, γ)
- Coding Textured Triangles
- Quiz: Texture Mapping

21. Perspective Correct Interpolation

- Perspective Correct Interpolation
- What Does "Affine" Mean?
- 3D UV Coordinates

22. Decoding PNG Files

- Decoding PNG Files
- Loading PNG File Content
- Freeing PNG Textures from Memory
- Quiz: PNG Files

23. Textured OBJ Files

- Loading OBJ Textures Attributes
- Preventing Texture Buffer Overflow
- Rasterization Rules
- Visualizing Textured OBJ Files

24. Z-Buffer

- Implementing a Z-Buffer
- Exercise: Z-Buffer for Flat-Shaded Triangles
- Z-Buffer for Flat-Shaded Triangles
- Reviewing Dynamic Memory Allocation

25. Camera

- Camera Space
- LookAt Camera Model
- LookAt Camera Transformations
- Implementing a Variable Delta Time
- Coding a Simple FPS Camera Movement
- Quiz: Camera Transformations

26. 3D Clipping

- Frustum Clipping
- Frustum Planes
- Exercise: Frustum Planes and Normals
- Computing Points Inside and Outside Planes
- Intersection Between Lines and Planes
- Clipping Polygon Against a Plane
- Coding the Function to Clip Polygons Against Planes
- Visualizing Clipped Triangles
- Horizontal and Vertical FOV
- Clipping Texture UV Coordinates
- Clipping Space
- Quiz: 3D Clipping
- Deciding What Not to Render

27. Code Refactoring

- Working with Static Variables
- Refactoring SDL Global Variables
- Refactoring Light Code
- Simulating Low-Resolution Display with SDL
- Exercise: Camera Pitch Rotation
- Implementing Camera Pitch Rotation

28. Rendering Multiple Meshes

- Declaring Multiple Meshes
- Coding Multiple Meshes
- Coding Multiple Textures

29. Conclusion & Next Steps