Mathematics for Computer Games Development using Unity
4.6 (757 ratings)
7,700 students enrolled

# Mathematics for Computer Games Development using Unity

A Beginner's Guide to Essential Mathematics, Data Structures and Algorithms used in Game Programming applied in Unity
Bestseller
4.6 (757 ratings)
7,704 students enrolled
Last updated 4/2020
English
English [Auto-generated]
Current price: \$15.99 Original price: \$19.99 Discount: 20% off
5 days left at this price!
30-Day Money-Back Guarantee
This course includes
• 15 hours on-demand video
• 6 articles
• Full lifetime access
• Access on mobile and TV
• Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
• How to use bitwise operations to optimise processing and storage in games.
• Everything there is to know about vector mathematics and how to navigate in 2D and 3D space.
• The principles and practice behind collision detection with lines, line segments and ray casting.
• The beauty of affine transformations and the fundamentals in transforming game objects.
• What a quaternion is and how it is used to rotate game objects.
• How to build a mathematics library in C# from scratch.
Course content
Expand all 69 lectures 15:06:29
+ Introduction and Welcome
5 lectures 08:04

An overview of the content and purpose of the course by Penny.

Preview 04:00

H3D has a bustling online student community.  Here's how to get involved.

Join the H3D Student Community
01:15

Regularly asked questions you should check out before starting the course.

FAQs
00:25

Hints on how to proceed through the course.

How to Study This Course
00:22

An article covering some basic trigonometry concepts you should be familiar with.

Basic Trigonometry
02:01

This quiz will test your understanding of basic trigonometry.

Basic Trigonometry Quiz
10 questions
+ Bitwise Operations
12 lectures 02:37:31

In this lecture we will revise binary code and begin looking at setting individual bit values.

Preview 10:41

This quiz will test your understanding of the content we've covered on bits and binary.

Binary Quiz
10 questions

In this lecture we will discover how bit values in a a binary sequence can be used as flags and the operators that allow us to set them.

Bit Flags & Bitwise Operators
19:02

In this lecture we will complete the challenge from the previous lecture and discover how to turn bit settings off.

Turning Bit Flags Off
13:57

In this lecture we will examine how to match a bit sequence with a mask to check if one bit is set.

13:07

In this video I will present a solution to the challenge set at the end of the last lecture as well as discuss checking a bit mask for multiple bits being set.

Bit Mask Challenge Solution
14:50

In this lecture you will learn how to shift the order of bits in a sequence and how this can be used for sending data efficiently over a network.

Bit Shifting
10:56

This quiz will test your understanding of how bit shifting works.

Bit Shift Quiz
10 questions

In this lecture we will discover how to turn a single bit on and off while leaving others in tact and then examine a specific use of bit sequences in Unity.

Bit Toggling and Unity Specifics
17:05

In this lecture you'll be introduced to bit boards and learn how to store game board states as a binary sequence in an integer.

Bitboards
10:31

In this lecture we will begin work on creating a tiled game world that is represented by Bitboards.

Putting Bitboards Into Practice Part 1
19:31

In this lecture we continue working on the Bitboard game board representation and add some algorithms to work with its states.

Putting Bitboards Into Practice Part 2
17:56

In this lecture you will create a score calculating method and work out a score based on the location of player pieces in a Bitboard with tile pieces.

Putting Bitboards Into Practice Part 3
08:21

This quiz will test your understanding and skills in working with Bitboards.

Bitboard Quiz
5 questions
Other Bitwise Operation Hacks
01:34
+ Location
7 lectures 02:06:41

In this lecture we will examine the nature of the space we use to plot points and position game objects.

Cartesian Coordinates & Points
18:28

In this lecture we will create a class with methods to use the game view as a graph plotting area and explore the creation of points.

Plotting Points: A Simple Data Structure
17:08

In this lecture we will continue working with the Coords class to add the axis lines onto the screen and them finish up with a star sign challenge.

Drawing Lines: Solution
15:03

In this lecture we will extend the DrawGraph class to add gridlines.

Graph Line Challenge
16:05

In this lecture we will start working on a 2D game that will not only use your math skills to develop it but also test them when you play.

Practice Locating 2D Points on a Cartesian Plane
18:30

In this lecture we will add a UI system into the 2D math game to display positions of the tank and fuel.

Calculating Distance Part 1
19:42

This quiz will test your knowledge of points in 2D.

Points Quiz
10 questions

This lecture continues the building of the UI system and mechanics to add calculating distance part of the game challenge.

Calculating Distance Part 2
21:45
+ Vectors
15 lectures 03:26:55

In this video you will begin to learn about one of the most fundamental geometrical and mathematics concepts in games; the vector.

Preview 14:58

This video continues the initial investigation of using vectors to relocate points by adding in scaling factors.

Introduction to Vectors Part 2
16:13

This quiz is designed to test your understanding of the basics of vectors.

Vectors Quiz
25 questions

In this video we will investigate how to move a game object from one location to another by calculating the vector between them.

Vectors: Moving to a Point
16:47

This quiz will test your ability to perform calculations with points and vectors.

Vectors and Points Quiz
9 questions

In this lecture vector normal form will be introduced.

Vector Normal Form
19:01

This quiz will test your skills at calculating vector normals. (Please note that most of these values have been rounded up to 2 decimal places for readability)

Calculating Vector Normals Quiz
10 questions

In this lecture we introduce the dot product, learn how to calculate it and find out what it's uses are for determining the relative orientation of vectors.

Dot Product
16:51
Derivation of Vector Angle Calculation
00:27

This quiz will test your ability to calculate the dot product and comprehend the results.

Dot Product Quiz
10 questions

In this lecture we will write the method to turn a vector from facing in one direction to another given an angle to turn by.

Rotations
09:33

In this lecture we will examine how to determine which way to turn to face in a certain direction using the Cross Product of two vectors.

Cross Product
17:20

This quiz will test your ability to calculate the cross product and evaluate the answer.

Cross Product Quiz
10 questions

In this video you will be given the challenge of writing a 2D LookAt method to add to the math class that's being developed.

2D LookAt Challenge
10:20

In this lecture we will continue work on our 2D vector math game and add in the ability to set the angle of rotation via the UI.

Dot Cross Challenge
19:25

This video provides the solutions for the problems posed at the end of the last lecture.

Challenge Solutions
06:38

This quiz will test your skills at calculating angles and distances.

Turn Angle and Distance Quiz
5 questions

In this video you will be challenged to recreate the code of the Unity Rotate and Translate methods to create your own player controller for the tank.

Recreate Rotate and Translate Challenge Part 1
19:58

We continue in part 2 of this lecture by examining how to transform vectors from the world space into the local space of a game object.

Recreate Rotate and Translate Challenge Part 2
06:22

In this video we will take a look at how very similar, or in fact the same, all the operations we've been using on 2D points and vectors are in 3D space.

Moving from 2D to 3D
19:43

This quiz will test your understanding of working with points in 3D.

3D Points Quiz
10 questions

This quiz will test your ability to work with vectors in 3D space.

3D Vector Mathematics Quiz
20 questions

In this lecture we will explore the nature of 3D rotations and introduce Euler Angles.

Exploring Rotation in 3D
13:19
+ Intersections
13 lectures 03:15:17

In this lecture we introduce the parametric form for a line and discuss the differences between lines, line segments and rays.

Lines, Line Segments and Rays Part 1
18:56

In this lecture we complete writing a Line class to include in our math library and explore the use of linear interpolation.

Lines, Line Segments and Rays Part 2
13:37

This quiz will test your knowledge on lines, line segments and rays.

Lines Quiz
10 questions

In this lecture we will explore the parametric form of planes and students will develop their own plane class.

Planes
18:58

This quiz will test your ability to navigate through points on a plane by the addition of vectors.

Planes Points Quiz
10 questions

In this very short lecture we will quickly add another line constructor that will be used in later videos.

Another Line Constructor
01:50

In this section we will examine the mathematics behind determining the intersection of two 2D lines and begin programming it into our Maths library.

Intersection of Two Line Segments
19:59

In this lecture we will improve on the line intersection algorithm to handle the restrictions of parallel lines and line segments.

Improving Line Intersection
14:42

This quiz will test your knowledge on line intersection calculations.

Line Intersection Quiz
7 questions

In this video you will be challenged to make a 2D ball travel along one line until it hits another line.

Line-Line Intersection Challenge
11:55

In this lecture we will examine how to determine where a line hits a 3D plane.

Line-Plane Intersections
19:58

In this video we will explore our investigation of line intersections and work on a reflection formulae to bounce a wall off a wall.

Line-Plane Intersections, Projections and Reflections
18:14

In this video we will extend line-line intersection and reflection to create a simulation of a 3D ball hitting a plane.

Plane Reflections
13:19

In this video we will take a look at the specifics of creating planes, rays and intersections in Unity using the game engine's own SDK.

Unity Specifics For Intersections
19:54

In this lecture we will discuss how to more a game object on a plane and keep it inside a boundary.

Preview 13:58

In this video we will come up with a solution to blocking an object inside a plane with many bounding planes using Unity specific code.

More Unity Specifics Part 2
09:57
+ Affine Transformations
14 lectures 03:18:50

This lecture will introduce you to the mathematical concept of matrices and explain what they are and how you can perform operations with them.

An Introduction to Matrices
08:26

This quiz will test your skill at working with matrices.

Matrix Quiz
10 questions

In this lecture we will examine a new way of representing vectors and points that will assist with matrix multiplications to come.

Homogeneous Coordinates
05:28

In this lecture we will examine the matrix calculations required to achieve the transformations of translation, rotation and scaling.

Transformations
07:39

In this video we will start putting together a matrix class to store and perform operations on 2 dimensional arrays.

Matrices: Data Structures and Algorithms Part 1
19:26

In this lecture we will finish our work on the matrix class by adding multiplication and a few extra touches to the code.

Matrices: Data Structures and Algorithms Part 2
14:10

In this lecture we will create a translation matrix and have it move points around in a 3D world.

Translation
19:44

In this lecture we will create the matrix for scaling and discover how scaling isn't the only thing this transformation achieves when used.

Scaling
13:08

In this lecture we will examine the rotation matrices and build the code to perform rotations into the maths library.

Rotation
16:51

In this lecture affine transformations will be discussed and lead us into a closer look an an object's transformation matrix.

Affine Transformations
17:21

In this lecture you will implement the shear and reflection matrix operations.

Shear and Reflect Challenge
11:28

In this lecture we are introduced to Quaternions and examine why they are a better alternative to Euler Angles for rotation.

Quaternions
17:55

This quiz will test your understanding of the content we've covered on quaternions.

Quaternion Quiz
5 questions

In this lecture you will implement the quaternion creation and use algorithms into the math library.

Programming Quaternion Rotations
19:41

In this lecture we will test the new methods for getting the angle of rotation and rotation axis from a transformation matrix.

Extracting the Rotation Axis and Angle
10:52
Quaternion Rotations
16:41
+ Final Words
3 lectures 13:10

This article has the final version of the maths library code attached as a resources.

Final Maths Library Code
00:03

A brief summary of your journey.

Some Final Words from Penny
01:51
Where to now?
11:16
Requirements
• Familiarity with the Unity Game Engine
• Confidence in programming with C#
• Mathematics skills to high school level (basic trigonometry and algebra).
Description

Did you know computer games use mathematics to perform every single task, from rendering to animation and physics to AI?  Mathematics is everywhere.  A fundamental understanding of mathematics is critical in every occupation and nowhere is it more important than in games development. It underpins all primary operations performed by a game engine.  You can't even move a character across the screen without it.  Keen to learn more and build up your knowledge in mathematics to improve your game development skills?  Then this course is for you.

In this course you will build your own C# classes to work with the geometrical constructs of 2D and 3D space that will develop your understanding of positioning and moving game objects. In short you will build your own maths library to replicate some of Unity's Vector2, Vector3, Matrix4x4 and some Mathf methods.  Throughout, we will be using the Unity Game Engine to help emphasise the mathematics concepts.

Join Dr Penny de Byl as she introduces game development mathematics using her internationally acclaimed holistic teaching style and expertise from over 25 years of teaching, research and work in games and computer graphics. Through-out the course you will follow along with hands-on workshops designed to teach you the vital mathematical techniques used in programming computer game mechanics and visuals.

During the course we will be building a game that not only uses the code we've written to move 2D and 3D objects around on the screen, but to play the game you will have to use your knowledge of points and vectors to solve puzzles that will reinforce your learning.  You will also build numerous mini projects to apply mathematical concepts and see how they work in games environments.

Learn how to program and work with:

• Bitwise Operations, Bit Packing and Bitboards

• 2D and 3D Space

• Points

• Vectors

• Matrices

• Mapping from one coordinate system to another

• Positioning Objects

• Angles

• Interpolation

• Quaternions