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

From Chilipedia
Jump to: navigation, search
(Video Timestamp Index)
(Video Timestamp Index)
Line 16: Line 16:
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==
 
[https://youtu.be/iNCx0yIeCNc Tutorial 5.1]
 
[https://youtu.be/iNCx0yIeCNc Tutorial 5.1]
 +
<div class="mw-collapsible mw-collapsed"><br />
 
* Matrices: what are they, what are they good for? [https://youtu.be/iNCx0yIeCNc?t=0m44s 0:44]
 
* Matrices: what are they, what are they good for? [https://youtu.be/iNCx0yIeCNc?t=0m44s 0:44]
 
* Basic Matrix operations: Matrix by Vector multiplication [https://youtu.be/iNCx0yIeCNc?t=3m05s 3:05]
 
* Basic Matrix operations: Matrix by Vector multiplication [https://youtu.be/iNCx0yIeCNc?t=3m05s 3:05]
 
* Creating a templated <code>_Mat2<T></code> Matrix class [https://youtu.be/iNCx0yIeCNc?t=7m16s 7:16]
 
* Creating a templated <code>_Mat2<T></code> Matrix class [https://youtu.be/iNCx0yIeCNc?t=7m16s 7:16]
 +
<div class="mw-collapsible-content">
 
:* Matrix data stored as 2D array <code>T arr[2][2]</code>
 
:* Matrix data stored as 2D array <code>T arr[2][2]</code>
 +
</div>
 
* Implementing the Matrix by Vector multiplication method [https://youtu.be/iNCx0yIeCNc?t=9m21s 9:21]
 
* Implementing the Matrix by Vector multiplication method [https://youtu.be/iNCx0yIeCNc?t=9m21s 9:21]
 
* Testing in <code>game.cpp</code> [https://youtu.be/iNCx0yIeCNc?t=13m00s 13:00]
 
* Testing in <code>game.cpp</code> [https://youtu.be/iNCx0yIeCNc?t=13m00s 13:00]
Line 33: Line 36:
 
:* Concatenating matrices cuts down the number of vector operations needed at runtime
 
:* Concatenating matrices cuts down the number of vector operations needed at runtime
 
* What about translation? [https://youtu.be/iNCx0yIeCNc?t=31m20s 31:20]
 
* What about translation? [https://youtu.be/iNCx0yIeCNc?t=31m20s 31:20]
 +
</div>
  
 
[https://youtu.be/CS4HQdQnbaA Tutorial 5.2]
 
[https://youtu.be/CS4HQdQnbaA Tutorial 5.2]

Revision as of 06:28, 14 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
  • Flipping the y-axis
  • Rotation
  • 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

  • Timestamps WORK-IN-PROGRESS

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