Difference between revisions of "Advanced C++ Programming Tutorial 5"

From Chilipedia
Jump to: navigation, search
(Tutorial 5.2)
(Tutorial 5.2)
Line 44: Line 44:
  
 
===[https://youtu.be/CS4HQdQnbaA Tutorial 5.2]===
 
===[https://youtu.be/CS4HQdQnbaA Tutorial 5.2]===
* Translation: why is it a complicated transformation? [https://youtu.be/CS4HQdQnbaA?0m14s= 0:14]
+
* Translation: why is it a complicated transformation? [https://youtu.be/CS4HQdQnbaA?t=0m14s= 0:14]
* Trick: augment the matrix (add an extra dimension) [https://youtu.be/CS4HQdQnbaA?3m11s 3:11]
+
* Trick: augment the matrix (add an extra dimension) [https://youtu.be/CS4HQdQnbaA?t=3m11s 3:11]
* Implementing a <code>Mat3</code> class for (3x3) matrices [https://youtu.be/CS4HQdQnbaA?6m54s 6:54]
+
* Implementing a <code>Mat3</code> class for (3x3) matrices [https://youtu.be/CS4HQdQnbaA?t=6m54s 6:54]
* Implementing a <code>Vec3</code> class for (3x1) vectors [https://youtu.be/CS4HQdQnbaA?8m51s 8:51]
+
* Implementing a <code>Vec3</code> class for (3x1) vectors [https://youtu.be/CS4HQdQnbaA?t=8m51s 8:51]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
* [https://youtu.be/CS4HQdQnbaA?m=s= :]
+
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
 +
* [https://youtu.be/CS4HQdQnbaA?t=ms :]
  
 
== Links ==
 
== Links ==

Revision as of 15:37, 18 April 2020

Hot take: the Matrix is a mediocre film at best. It's a pretty great way to encode transformations though, so let's matrix it up!

Topics

Part 1

  • Matrix form
  • Matrix by vector multiplication
  • Matrix encoding of scaling, rotation, and flipping
  • Matrix multiplication
  • Concatenating matrix transforms

Part 2

  • Augmented 3x3 matrix for encoding translations
  • Matrix multiplication order matters!
  • Porting pipeline to use matrix transforms
  • Bug hunting!

Video Timestamp Index

Tutorial 5.1


  • Matrices: what are they, what are they good for? 0:44
  • Basic Matrix operations: Matrix by Vector multiplication 3:05
  • Creating a templated _Mat2<T> Matrix class 7:16
  • Matrix data stored as 2D array T arr[2][2]
  • Implementing the Matrix by Vector multiplication method 9:21
  • Testing in game.cpp 13:00
  • Implementing basic transformations in Matrix form as static functions 15:16
  • Scaling & Identity Matrices 17:13
  • Flipping the y-axis 18:01
  • Rotation 18:56
  • Testing in game.cpp 21:25
  • Basic matrix operations: Matrix multiplication 23:06
  • Implementing & testing the Matrix multiplication method 25:52
  • Recap: concatenating transformations by multiplying transformation matrices 30:10
  • This is the beauty of matrix operations: one single concatenated matrix holds all the transformation information
  • Concatenating matrices cuts down the number of vector operations needed at runtime
  • What about translation? 31:20

Tutorial 5.2

  • Translation: why is it a complicated transformation? 0:14
  • Trick: augment the matrix (add an extra dimension) 3:11
  • Implementing a Mat3 class for (3x3) matrices 6:54
  • Implementing a Vec3 class for (3x1) vectors 8:51
  • :
  • :
  • :
  • :
  • :
  • :
  • :
  • :
  • :
  • :
  • :
  • :

Links

  • GitHub Repo (advmath)
  • Note that the code for this tutorial can be found on the <starfield> branch of the repo not in <master>

Homework

None! (or check out 3D Fundamentals you lazy fucks!)

See also