Math for Game Devs [2022, part 3] • Matrix4x4 & Cross Product

  Рет қаралды 133,875

Freya Holmér

Freya Holmér

Жыл бұрын

Primarily for my students at FutureGames - I will only read chat/superchats during breaks!
Assignments here!! ❱ acegikmo.notion.site/Lectures...
Find out more about the school at futuregames.se/
❓ FAQ ❱ acegikmo.notion.site/FAQ-8b62...
💖 Support me on Patreon ❱ / acegikmo
📺 I usually stream on twitch ❱ / acegikmo
💬 Join my discord ❱ / discord
🐦 Follow me on twitter ❱ / freyaholmer

Пікірлер: 53
@sparlott1347
@sparlott1347 Жыл бұрын
Lecture starts here: 5:21
@cosmicg_oth
@cosmicg_oth 6 ай бұрын
5:21 Matrices 56:00 Matrix Inversion 59:10 Last Row of the Matrix4x4 1:03:10 Break/Questions 1:36:09 Shows off game/Use cases for Dot product & Matrix transformation 1:44:25 Coordinates 1:48:47 Cross product 2:02:20 Break 2:10:30 Cross product use case (Will add the rest when I finish the video)
@Zarial_
@Zarial_ 3 ай бұрын
Did you finished ? 👀
@soupmachine5831
@soupmachine5831 Жыл бұрын
Blessed be the queen of programing, my here shining light touch all our source codes.
@PaulKingIII
@PaulKingIII 11 ай бұрын
I fell asleep and I woke up and this was playing
@JulsGeekPI
@JulsGeekPI Жыл бұрын
Thanks for sharing this
@francoperez4593
@francoperez4593 3 ай бұрын
49:00 1:26:30 1:40:50 1:44:50 1:53:30
@Horoprime
@Horoprime 9 ай бұрын
It's really hard to navigate without chapters/timecodes, could you please add them? Overall it's a great course, thank you very much!
@IrocZIV
@IrocZIV Жыл бұрын
Thanks
@Ludrien
@Ludrien Жыл бұрын
Really high quality content. Love your lectures!
@xhivo97
@xhivo97 10 ай бұрын
Love how unread engine is on its own on the coordinate system chart 😂 (to be fair it's the most intuitive for me too, since probably im guessing xy on 2d and xy on 3d games is the same)
@itsm0saan
@itsm0saan Жыл бұрын
Hey, I would like to say thank you^^
@juliopolo7216
@juliopolo7216 4 ай бұрын
That game looks similar to Data Wing. Love that one. Great video, I learnt a lot.
@nigeltan7766
@nigeltan7766 11 ай бұрын
do transformation matrices need to have orthogonal basis vectors? that is, do the basis vectors of local space have to be orthogonal for our local-to-world transformation?
@vima9046
@vima9046 Жыл бұрын
At minute 52:12 the explanation is a little bit confusing because i think if we want to do what you are explaning (find a relative direction from us) we should use "InverseTransformDirection" instead and not TranformDirection. Using TransformDirection would be true only if the object that is calling TranformDirection is not rotated.
@kjanahan3776
@kjanahan3776 10 ай бұрын
there was a typo; it should have been M^-1*(v.y, v.x, v.z, 1), you should be able to replicate it by calling transform.TransformDirection()^-1, the inverse of a function could be represented as if f(y) = x, then putting y in the inverse of f should give you x. the previous section where she explained how multiplying a 4x3 matrix by a 1x4 matrix would give you local to world ,multiplying the by the inverse of the 4x3 matrix should give you world to local
@MertowVA
@MertowVA Жыл бұрын
Even though I know my matrices it's nice to see the way you implement code. These are great!
@adammilner7215
@adammilner7215 Жыл бұрын
Ygiucx
@adammilner7215
@adammilner7215 Жыл бұрын
Yho
@adammilner7215
@adammilner7215 Жыл бұрын
Cx
@adammilner7215
@adammilner7215 Жыл бұрын
😊
@adammilner7215
@adammilner7215 Жыл бұрын
😊
@blackpanda1302
@blackpanda1302 Жыл бұрын
❤️❤️thx
@SuthernHunter
@SuthernHunter 11 ай бұрын
Does anyone know where you can buy those 3D axis models she showed? Having a physical thing I can use as reference always helps and I can't draw 3D space to save my life.
@NOT_A_ROBOT
@NOT_A_ROBOT 10 ай бұрын
you can probably just make one yourself with some toothpicks, glue, and paint for color
@vima9046
@vima9046 Жыл бұрын
Hello Freya! There is one thing that i don't understand. Maybe it's just because i don't have much experience with this stuff. My question is in the exemple as the minute 49:30 why should we calculate the offset in local space using the appropriate functions and than find the position in world space instead doing everything in global coordinates? (In short i don't undesrand if is necessary switching from local to global system). Thanks in advance!
@samuelmorey9097
@samuelmorey9097 Жыл бұрын
Hey Vincnet. In general it can be easier to reason through, and the math can be simpler, and better visualized when working in the local space coords. if you get a world space vector, you might have to do some Vector addition to get it in the proper spot. If you are just using local space coords, you know it will be in the correct spot without much thinking. Either way is valid, I think working in local space is just less mental overhead.
@acegikmo
@acegikmo Жыл бұрын
yep! I think I talk about this extensively during some of the assignment solution videos
@vima9046
@vima9046 Жыл бұрын
@@samuelmorey9097 Thanks a lot for the reply! Yes, watching the assignment solution video i just realized how can be helpful :)
@Oryxide
@Oryxide 9 ай бұрын
Do the contents of a rotation matrix change depending on if Y is up instead of Z?
@cptwoody7103
@cptwoody7103 2 ай бұрын
somehow unity using left hand rule with Y is up . speaking of transform rotation matrix itself, orientation will depend on where each basis vector land so yes it depend on which current basis vector goes
@Byynx
@Byynx 11 ай бұрын
I think unity it's not the best tool to explain and create real case scenarios. You should code outside game engines weather using opengl or directx api.
@jasonlaw4659
@jasonlaw4659 10 ай бұрын
Another remarkable representation of life and the world we live in. The more knowledge we accumulate the greater our abilities become to go on and do great things.
@vima9046
@vima9046 Жыл бұрын
I tried to set the trasform.position of an gameobject equal to a vector4 (2,2,2,0) believing that the value of "w" set to 0 would not change the position of the object but only rotate it. Instead the object got the position of 2,2,2 in the global world. Was it me who misunderstood that "w" set to zero would just rotate the object or is there something strange?
@acegikmo
@acegikmo Жыл бұрын
transform.position only uses a Vector3, the w component is only used when you're using matrices directly, like transform.localToWorldMatrix
@vima9046
@vima9046 Жыл бұрын
@@acegikmo Thanks for clarifying me! ♥️
@pazalla
@pazalla Жыл бұрын
Hi @Acegikmo, I have a problem at 2:33 (kzfaq.info/get/bejne/nbyXgZiEupymonU.html) because when I draw the normal it is wrong. I fixed it changing this line of code: Gizmos.DrawLine(raycastHit.point, raycastHit.normal); => Gizmos.DrawLine(raycastHit.point, raycastHit.point + raycastHit.normal); Maybe I miss any setting? Thanks and best! You are doing a fantastic job!
@nikent8517
@nikent8517 Жыл бұрын
Gizmos.DrawLine's second parameter works in world space, so when you put normal's vector in there, it will project this vector from world space, not from hit space It also would work if you used Gizmos.DrawRay, because it's second parameter project needed vector from first parameter position
@OmarAlmokhtar0
@OmarAlmokhtar0 8 ай бұрын
should I have fluency in unity to solve the assignments ?
@yasasvitennety4885
@yasasvitennety4885 14 күн бұрын
It's good to know some basic things like Vector transforms and Raycasts, but apart from that it's all mostly logic-related.
@matthewpublikum3114
@matthewpublikum3114 Жыл бұрын
So, vector V's point of origin is P, and using the coordinate space of vectors x,y,z?
@user-sq3sb7qn3m
@user-sq3sb7qn3m 7 ай бұрын
blud i fell asleep w my pc on and this came on
@vovchisko-dev
@vovchisko-dev Жыл бұрын
Lol, people paying 40$ for broken games, while you hiding so satisfying thing on your hard drive. Shame! Push it immediately!
@vladotanja8890
@vladotanja8890 10 ай бұрын
3:02 3:02 3:02
@Aleteos
@Aleteos Жыл бұрын
I... am so confused. I thought for sure you had made a mistake using column vectors in your 4x4 matrix instead of row vectors, so I tried making a modification in my own code to test it. I'm implementing a ladder in GZDoom's ACS script, so there's no built in matrices, not even 2d or 3d-vectors. It's all per element multiplication of arrays. Fun times! I want to transform the players position in world space to ladder space, as defined by a line(doom maps are drawn as top-down 2d) and I thought I had it all figured out after the last lecture "yesterday"(part 2). I got the delta subtracting a point on the middle of the line from the player's global coordinates, then I assign the ladder space x coordinate by multiplying the x-component of the ladder's right vector with the delta's x-component and add to that the product of the y-component of the ladder's right vector and the delta's y-component. (then basically the same for the y-component) But doing it like you're suggesting in this video, I should multiply the x-component of the ladder's right vector with the delta's x-component, then add to that the product of the x-component of the ladder's out vector and the delta's y-component... and it works. In fact, I get the exact same results. I don't even know how that makes sense. This should suggest that instead of scalar projection against each basis vector in turn, one could dot with the x-components(then y-components) of both basis vectors, and arrive at the same result? My brain is broken now. ...wait, of course they're the same I literally made them the same value ladderRight is [cos(ladderAngle), sin(ladderAngle)] and ladderOut is [sin(ladderAngle), -cos(ladderAngle)] I've literally just flipped the "matrix" around the diagonal, haven't it...
@mathbbn2676
@mathbbn2676 10 ай бұрын
💝💝💝💝
@isilozcelik
@isilozcelik Жыл бұрын
@metehanerkol2837
@metehanerkol2837 Жыл бұрын
@maju-mu7rr
@maju-mu7rr 10 ай бұрын
wowo
@tcheikovski230
@tcheikovski230 6 ай бұрын
Banana
@tisalee04
@tisalee04 10 ай бұрын
uyuhuhuhu
@brothertyler
@brothertyler 10 ай бұрын
I could tell that you were a man from your thumbnail icon, and did not even need to hear your masculine voice. It's not too late to make the return journey.
Why can't you multiply vectors?
51:16
Freya Holmér
Рет қаралды 384 М.
маленький брат прыгает в бассейн
00:15
GL Show Russian
Рет қаралды 3,2 МЛН
Who enjoyed seeing the solar eclipse
00:13
Zach King
Рет қаралды 116 МЛН
The Continuity of Splines
1:13:50
Freya Holmér
Рет қаралды 1,3 МЛН
The Lorenz System in Python  (code In description)
6:08
Theoretical Mindset
Рет қаралды 91
Intro to Tool Dev in Unity [part 2/4]
3:53:56
Freya Holmér
Рет қаралды 54 М.
The Beauty of Bézier Curves
24:26
Freya Holmér
Рет қаралды 1,9 МЛН
Intro to Tool Dev in Unity - An Improvised Live Course [part 1/4]
3:39:31
Normal Maps, Tangent Space & IBL • Shaders for Game Devs [Part 3]
3:18:11
Floating Point Numbers - Computerphile
9:16
Computerphile
Рет қаралды 2,3 МЛН
Healthbars, SDFs & Lighting • Shaders for Game Devs [Part 2]
3:30:03
Freya Holmér
Рет қаралды 210 М.