cinera_handmade.network/cmuratori/hero/code/code361.hmml

46 lines
4.3 KiB
Plaintext

[video output=day361 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Introduction to 3D Rotation Matrices" vod_platform=youtube id=zU5Yyls5uwM annotator=Miblo]
[0:07][Recap and set the stage for the day]
[1:57][Run the game to demo the current state, with a few words on moving towards a more direct streaming approach]
[5:18][handmade_platform.h: Remove the sort data from game_render_commands]
[9:59][handmade_opengl.cpp: Make OpenGLRenderCommands() correctly push textures]
[14:10][handmade_render_group.cpp: Make PushClipRect() call PushRenderElement()]
[16:41][handmade_opengl.cpp: Enable OpenGLRenderCommands() to handle the cliprect case, and run the game to see it working]
[19:13][todo.txt: Update the TODO list with a few words on making a freely rotatable camera]
[24:40][Blackboard: Rotation Matrices]
[30:42][Blackboard: Deriving a Rotation Matrix]
[36:25][Blackboard: 3D Rotation Matrices]
[40:18][Blackboard: 2D vs 3D Axes of Rotation]
[43:56][Blackboard: Coordinate system handedness]
[50:45][Blackboard: Rotating in 3D around the cardinal Z axis]
[58:28][Blackboard: Generalising this to the other axes]
[1:10:43][Blackboard: Solving for a freely movable camera, using matrix multiplication]
[1:23:20][Blackboard: Matrix multiplication in summation notation]
[1:27:57][handmade_math.h: Introduce operator*() that operates on a 4x4 matrix]
[1:37:07][Blackboard: Determining the shape of the matrix product]
[1:39:23][Blackboard: Transforming points]
[1:41:39][handmade_math.h: Introduce Identity(), XRotation(), YRotation() and ZRotation()]
[1:48:04][handmade_math.h: Introduce Transpose()]
[1:48:21][Blackboard: Matrix Transpose]
[1:50:35][handmade_math.h: Introduce Projection()]
[1:53:49][handmade_opengl.cpp: Make OpenGLRenderCommands() project and transpose our matrix]
[1:55:32][Step into OpenGLRenderCommands() and inspect the projection matrix]
[1:56:40][handmade_math.h: Make our new operator*() and Transpose() loop over all the values]
[1:57:14][Step into OpenGLRenderCommands() again to see the transpose working correctly]
[1:58:28][Q&A][:speech]
[1:59:24][@a_pulsing_mage][You once said that people don't really use matrices as the storage in real world things. Can you talk about the alternatives?]
[2:02:41][@desuused][Will we use quaternions? Producing rotation matrix from quaternions seems a good idea]
[2:03:09][@neitchzehrer][So from now on, you will only be streaming on Saturday and Sunday?]
[2:03:19][@pepevel][Would it be worth investing time doing a SIMD optimization for matrix multiplication, or is it like killing ants with a rifle?]
[2:04:25][@pandamite][Are you going to use simpler rotation functions that are mainly focused on smaller matrices such as your 4x4, then emphasizing another method on much larger matrices?]
[2:04:54][@felkcraft][Is it worth having code for producing a full rotation matrix (x, y and z) at once instead of multiplying three different matrices?]
[2:06:23][@zilarrezko][I'm inferring that those braces encompassing the four rows in those matrix operations aren't doing anything? (It isn't creating an extra dimension in the matrix?)]
[2:08:08][@zamar037][Hi Casey, haven't caught a stream in a while. How are things going?]
[2:09:09][@pepevel][Don't you have to return a value in the multiplication function?]
[2:11:33][@emosaru][Q: Casey, might be worth pointing out that that behavior in MSVC is specific to inline functions]
[2:13:21][@pandamite][I kind of just joined on to this channel. Sorry about the lack of the knowledge of the code so far, but I was referring to the case of having such large matrices that you would consider partitioning the matrices into separate parts for quicker rotations]
[2:17:01][@vaualbus][Would it not be better to make the matrix struct use an r32 array of 16 elements instead of a two dimensional one? In that should we SIMD the math operation?]
[2:19:10][@teamrandb][Forgive the dumb question, but why are your include guards defined at the bottom of the header instead of the top? Is this purely what you chose to do, or is there another purpose? (#if is checked at the top, but the #define is at the bottom. Most code I've seen does it at the top)]
[2:21:47][@teamrandb][Sorry, Casey, I am still looking at older streams. I guess you may have changed that already]
[2:22:58][Get going with a glimpse into the future][:speech]
[/video]