I've learned more in two days watching these videos than 6 months taking math classes
@MrGhoulie Жыл бұрын
I fell asleep watching product review videos and woke up to this playing
@kiddcavalierdjmcandlilgas5331Ай бұрын
Bro how the fuck did we do the exact same thing?
@usoppgod81073 жыл бұрын
This is very informational. Specially the 3D stuff around cross products and how we use them in the games. Thank you Freya
@TimRex.3 жыл бұрын
I think I've finally had an "aha!" moment around transformations between coordinate spaces... The key that I was missing was in visualising the basis vectors of each coordinate space as having the same origin, then the transform for "each individual axis" is nothing more than a scaling factor!! Particularly so, since they're unit length. I had trouble previously understanding exactly why we could multiply a point by the basis vectors of the transform, and for that to somehow manifest as a rotation. (It's wierd, I've learned so much beyond this fundamental principle and only just now "getting" it).
@tljstewart2 жыл бұрын
Thanks @Tim, I feel similar; your shared insight was the last piece I needed! "aha"!
@ernststravoblofeld Жыл бұрын
When you get that, all the things you thought you knew about GPUs and parallelism come into sharp focus.
@im-Anarchy11 ай бұрын
3b1b
@badrakhariunchimeg103110 ай бұрын
not importand so thankyou
@Chris_t03 жыл бұрын
You are a legend I never understood this at uni, so i just moved on and used things, did things but didnt understand it enough to do anything without googling it and seeing someone elses solution, this just made everything super easy in that i can finally work things out myself saving some time!
@naknuknik2 жыл бұрын
For those having trouble undeerstanding how the "orientation" and "scale"(the 3x3 part) frorm the matrix change our vector I recommend the first3 videos from "three blue one brown" channel's Essence of linear algebra"(if youre very lazy just watch the 3rd one,but I really recommend all of them) where he has a really nice visualization for this where any vector on the plane is defined as being made up of basis vectors(normal x, y, z vector aka our transform.right/up/forward - except they get normalized in unity) and so if you change basis vectors - you "warp" all defined vectors(space itself!). This is actually where doing exercise 3 helps a bit as well, as its a good example of this. The TL;DR version of it is: every vector can be defined as made up of scaled up basis vectors, so for example: a vector (2;3) is actually 2 * transform.right(gives us (2;0) normally) + 3 * transform.up ( gives us (0;3) normally) and if you change the basis vectors to be something else you "warp" all vecots with it.Very hard to explain in words,the animation in that video makes this 100x easier to understand. Edit: do beware that I think he orientates the basis vector definitions into a column as opposed to the rows we see here, which can confuse people(like me). Edit2: Nevermind,it was changed in this video as well.(I still find it harder to understand with basis vectors being columns for some reason, cant seem to multiply in my head)
@mauriciopartnoy27893 жыл бұрын
I found these classes a couple of days ago, awesome stuff! I really like how you present practical use cases for the things you are teaching.
@tojynick3 жыл бұрын
Thank you, best math teacher~
@ajarivas723 жыл бұрын
I agree
@fuzzyherbivore1933 жыл бұрын
Math with disgruntled cat noises in the background is best math! Thank you so much for doing this, it is so super helpful!!
@jull123411 ай бұрын
disagree wholeheartedly about the cat noises .
@zekrinealfa11135 ай бұрын
@@jull1234 Yeah, I've come to hate the cat with a passion during the lectures, so damn annoying.
@barabanus3 жыл бұрын
1:46:56 You're wrong about the forth row of 4x4 transformation matrix as needed for "matrix multiplication to work". You may multiply 3x4 matrix by 4x1 [augmented] vectors without a problem, getting correct 3x1 vectors as result. The reason to have the fourth row is to map points in 3D space to vectors in projective 4D space, so every point on a vector in 4D space corresponds to the same point in 3D space. So for linear transformations you need 3x4 matrix, for projection transformation you need 4x4 matrix.
@crossface666 Жыл бұрын
After being confused and banging my head for 4 hours, finally got what Freya did with the space transformations exercise. Thank you.
@gutzimmumdo49102 жыл бұрын
really nice videos for people that want an introduction to math in game dev, very cool seeing someone actually explain the math using geometry aswell instead of just numerical representations, altou; 3:34 there is a way to compute the "projection vector" of "a onto b", namelly; "vector v", no nesesity for unit vectors with this projection formula: (b.a / b.b) . b = v That formula will give u the projection vector "a onto b" (vector v), where vector "v" is in the direction of vector "b", and the lenght of "v" is independent of the lenght of "b", for example: if b is scaled by a factor of 3, then the formula would look like this; (3b . a / 3b . 3b) . 3b = v if we factor the 3´s we get: [3 * 3 * (b . a) / 3 * 3*(b . b)] . b so, as u can see, all the 3´s asosiated to the b´s get canceled and we get the previous formula (b.a / b.b) . b = v "v" will be dependent on the lenght of "a" sinse thats the vector we are projecting onto b. This formula is used when u dont know the angle teta.
@SergeyBerengard2 жыл бұрын
Freya, you're a very good teacher. That's rare.
@LiveWire937 Жыл бұрын
I have to watch these videos with headphones on now because Thor convinced my cat that there's a poor neglected cat friend trapped in my bookshelf speakers, and she keeps trying to bust him out of there.
@bxbvxbv3 жыл бұрын
when u started explaining world to local it was so confusing I suddenly forgot all the vector stuff from last video. 🤣
@synth323 жыл бұрын
Really love your series! I tested the transform.Direction function and it doesn't return a normalized Vector, so be aware of that.
@acegikmo3 жыл бұрын
ah yeah, looks like the defining feature of it is that it ignores scale, unlike vector, so it keeps the same vector length as the input I personally never use it because I never have a use case for it, and when I want normalized directions I usually use TransformVector anyway
@th3lazyguy3 жыл бұрын
Thank you so much for this series! :)
@mdaszadqureshi1483 жыл бұрын
Your teaching is amazing, love from India
@sergio26923 жыл бұрын
thank you, you are saving my life
@exe.m1dn1ght2 жыл бұрын
man i just love that ,,aha! i finally got it ! ,, feeling !! that's why i like programming.. at first its complicated , but then you have that amazing aha moment where you feel the power in your veins mixed with happines and a feeling of satisfaction
@deecsaunders2 жыл бұрын
"So we don't have to press the play button.. cause that's gross!" :D - love it.
@crazy-boy61433 жыл бұрын
1:31:26 and now I draw tow vectors to visualize the view horizontal of the enemy/player. Instead of just a circle it's now just a part of the circle which can be easily adjusted by the viewAngle. I have been learning those stuff for 2 years, tho I didn't figure that out. it looks like we human need to use more time on thinking of how to use what we learned lol. Btw thanks for those videos. I'll probably watch them all hopefully you have many of them
@jadejaparth66863 жыл бұрын
Hey, many many thanks for this series! Where can I find more assignments or problems to practice this kind of gameplay development? I would like to practice gameplay which includes more math stuff.
@isay6853 жыл бұрын
I just love the way you teach...
@yudoball3 жыл бұрын
Same
@ajarivas723 жыл бұрын
@@yudoball same here. Hypnotic
@antonchigurh81023 жыл бұрын
Insanely smart
@krisztianbotos168 Жыл бұрын
Hi Freya, thanks for sharing your knowledge, you are awesome! I got the same results on converting local position to world position with a different approach. I made a V2 desiredWorldPosition -> V2 parentToChildPosition = desiredWorldPosition - parent.position -> child.position = parent position + parentToChildPosition.
@SantiagoMolano048 ай бұрын
Watching your vids befor emy calc 3 exam lmao. Super super helpful.
@NipunDavid3 жыл бұрын
The fucn which is LocalToWorld...shouldn't it be renamed WorldToLocal?? as we are converting wold coordinates to local space
@paradox95513 жыл бұрын
Yeah I got really confused about this as well??
@caesium83492 жыл бұрын
Exactly. I think that too. I think correct one is WorldToLocal.
@marverickbin2 жыл бұрын
The 3.c assingment could be to transform a local space of an object to the local space of another object.
@ecapanema3 жыл бұрын
very nice material, thanks for the effort
@markmanning29213 жыл бұрын
Just discovered your vids, watched your vid on bezier curves, then went looking for more and found math for games part 1.... ive been doing low level, realtime embedded control applications for donkeys years with NO MATH. I SUCK at math lol... because every time i try learn it i fall asleep listening to someone speak in a language I do not understand. not only are you very beautiful
@zenithparsec Жыл бұрын
28:47"lookness" was exactly the name I would use. Good choice. ;]
@gutzimmumdo49102 жыл бұрын
2:04:08 so what u are doin is basically a change of basis?
@supertenchoo42712 жыл бұрын
please make a video about field of view effects I really want a depth video about that from you
@maiksonstrife3 жыл бұрын
Long Story short for Dot Product. 1. You need at least 1 normalized Vector to project into another. A common use is to project a not normalized one into a normal surface. 2. You ends up with two possibilities: Not-Normalized x Normalized & Normalized by Normalized. Normalized x Normalized: Exclude the length of the vector and end up with only a direction: 1 (same direction), 0 ( perpendicular ), -1 (Opposite). Not-Normalized x Normalized: dot returns a length in a scalar. This scalar represents how far the direction projected along the distance axis == values -> Same direction - values -> Towards opposite direction + values -> Towards Same Direction Scalar length : How far it projected
@TheArtofCodeIsCool3 жыл бұрын
Great stuff!
@beaumanVienna2 жыл бұрын
"it's also a good gang sign. if u'r left-hand crew or right-hand crew u can do yr gizmos" LOL 2:24:44
@supertenchoo42712 жыл бұрын
Thanks for the great video I would love to see more cross-product videos with practice like how to make hot seekers missile in unity
@MBoufernana3 жыл бұрын
40:50 the closer humanity have got to time travel
@xarcaz Жыл бұрын
An addendum regarding the optimization in regards to spaces @ ca. 53:11. Instead of just doing everything in local space, it's often better to just pre-multiply all the space transforms into a single transform and uploading that to the GPU in a uniform buffer. Then you just need to compute a 4x4 MVP projection matrix once per frame per rendered object, then this matrix can be used for all its vertices or whatever you need it for. And IMO, this characteristic of linear algebra is its biggest strength; e.g. if you need need to perform a complex chain of transforms (lerping between animation key frames in object space, applying local space transforms, applying world space transforms, etc; then you just need to do the calculation once and then you can re-use the resulting transformation as a single matrix operation millions of times in a massively parallel manner. And this also explains why GPU designs and graphics pipelines are the way that they are and why linear algebra is so ubiquitous in scientific simulations, machine learning, etc. And as a small tangent, this is also one of the benefits with tessellation for rigged meshes since you can apply the more "individual" and complex animation transforms while its in its low poly state and then do the tessellation step afterwards to reap the benefit of not having to do the costlier transforms on a magnitudes greater number of vertices (and instead just have to do much cheaper and more scalable transforms during the tessellation stage of the render pipeline). Of course, there are some less positive trade-offs as well which is why tessellation is slowly being phased out in cutting edge engines like UE in favour of more modern alternatives.
@GankablePlayer2 жыл бұрын
Thank you so much for the course!
@zekunyang46863 жыл бұрын
Really good
@hakanviajando Жыл бұрын
Amazing video, thank you very much.
@ajmetal28493 жыл бұрын
Thor's meows really adds a certain "Je nes sais quoi" to game development.
@ajvp23411 күн бұрын
Nice French ^^ I agree though
@jesperpersson93885 ай бұрын
Correction: at 1:42:00 Freya says that the x basis is the first row. That's not true. It's the first column. Unity uses column major matrices so that's maybe why it might be easy to make the mistake.
@epicbattles38873 жыл бұрын
Learned a lot. Thank you
@ericabaez30339 ай бұрын
I love your videos
@TimothyRHuertas9 ай бұрын
Thanks!
@zekiozdemir4202 жыл бұрын
Thank you learned a lot
@sandrahildebrand4283 Жыл бұрын
Left hand coordinate system rule Cross product AxB, - use left hand, point all fingers in direction of A, orient hand to be able to curl fingers towards closest way to B, extended thumb will be the resultant direction of cross product.
@ViniCavin2 жыл бұрын
Your channel is amazing! Thanks a lot for sharing your knowledge :)
@glaze46292 жыл бұрын
Your cat makes me think there's a cat in my ceiling, i'm paranoid
@Keimoj Жыл бұрын
I was about to comment on Task 2 reminding me about Amnesia Dark Decent and looking at mob/lights and next phrase is pretty much "..in a horror game..." (Just finished it again, great game)
@JohnDoe-mr6mq2 ай бұрын
Assignemnt 3 was hard to implement since you simply can't know how to get these up/right vectors relative to origin of an object. I there's a lot to it when you up to calculating transform.up / transform.right on your own, it defenitely takes into account object's rotation which was not discussed. Had a bad time and felt really stupid
@ManInBlackPants Жыл бұрын
Thanks! Useful!
@MJano793 жыл бұрын
Before the video starts, I’m already pushing like! You give us a lot of value! Ever since I found your channel, the concept of online teaching has given me a whole new meaning! Thank you very much! :)
@krissloo1433 жыл бұрын
ME TOO!!
2 жыл бұрын
Thank You!
@OscarGaya3 жыл бұрын
Fantastic videos Freya! . Did you thought on use a 3d app to explain math? ( Blender for example). I always thought that way, would be more visual and less abstract.
@acegikmo3 жыл бұрын
I find that they are more clunky and harder to draw freehand in! but I do use Unity when I have to visualize something accurately in 3D
@Morimea2 жыл бұрын
thanks, very useful!
@ernststravoblofeld Жыл бұрын
You use the 4th row and column of the matrix because translation isn't actually a linear equation, so you do a shear in 4 dimensions instead. Ed: I just deleted part of this that was ridiculously wrong. My apologies to anyone who read it.
@Seraian12 жыл бұрын
What I dont understant at 3:20 regarding the dot product is, since B is projecting on to a normalized A (Which is extended to infinity) And A's length is 1 due to normalization. Wont the dot product be greater than one according to the graph you drew?
@jordan.rushing Жыл бұрын
I'm halfway through, so forgive me if it's answered later on but I wanted to understand, if the basis is always 1 for x and 1 for y... why even multiply the vector? Isn't it just the vector's points already? What's the point that I'm missing and how does that multiplication translate it to global space
@jordan.rushing Жыл бұрын
Ok, I think I understand when going through matrix section. Seems like it's really not 1, it's the dot product to apply the rotation.
@TGUlricksen Жыл бұрын
I am 0....everything vectors out from this Dot. What will trigger events? Me? Self is playing along. BUT, who wrote the program? Need more information.
@marcolartategui4832 Жыл бұрын
1:57:54. Pygame developer: Fine! I'll do it by myself
@malekekko844910 ай бұрын
Is the math concrete weather we disagree on the topography?
@levveliki8888 Жыл бұрын
Wouldn't the 4th row in the basis matrix affect the result only if you use the w coordinate after the matrix multiply ?
@StainlessHelena3 жыл бұрын
I can't code for the life of me so I did the assignments in Excel and used diagrams for visualization (that one year studying civil engineering did pay off). All vectors were simply two numbers written next to each other.
@paradox95513 жыл бұрын
If you can do it in excel, you'll be able to learn coding in no time. It's really not that different. Pick up a programming book and you'll be able to do it :D
@rodericksibelius84722 жыл бұрын
Great we can use Vectors to present data from the energy feedback from sensors: gyroscopes, accelerometers, magnotometers to the Kalman Filter matrix vector complex equations to be solved by a computer to solve a real world control systems engineering such as a US Navy Military Drones as well as those used by Robotics manufactured by Boston Robotics... etc... etc... :)
@bithigh83012 жыл бұрын
Nice video! Where can I the real axis? :D I loved it
@semro2 жыл бұрын
I am a bit confused. So, is the result of cross-product defined by the handedness of the coordinate system? Because in Unity we use the left-handed rule, as the coordinate system is left-handed, and in pure math, we use the right-handed rule (as in Source Engine, Blender, Maya.. etc)
@acegikmo2 жыл бұрын
the cross product is independent of handedness! handedness is only a matter of how we display it all
@fazaaryoga40802 жыл бұрын
you should be teaching in my uni lol
@D_VAULTZ Жыл бұрын
how did you achieve the alpha blend on your webcam? i coded my own using bitwise operations on GDI bitmaps but it was never as smooth as it should be, suffered numerous aborations and artifacts. This is a problem i sunk over 100 hours in, shamefully.
@curiouspers3 жыл бұрын
NEAT
@bithigh83012 жыл бұрын
Hi Freya, which smart pen do you use?
@LieutenantAwesom33 жыл бұрын
shouldnt 4x4 matrix be used to encode 4d space and 3x3 to encode 3d? in order to transform 2d space you only need to multiply it by a 2x2 matrix. am i missing smth here?
@acegikmo3 жыл бұрын
3x3 is only enough to encode 3D rotation, but not translation. similarly, a 2x2 can only encode 2D rotation, but not a 2D position in addition to that
@LieutenantAwesom33 жыл бұрын
@@acegikmo ah, got it, thanks a lot!
@qrthack2 жыл бұрын
What tablet are you using? Please asnwer me
@bradbland93073 жыл бұрын
If the basis vector is always 1 then why ever even multiply by it... it will always come out the same as the local space point... I hope you understand what I mean ... you still ended up with the same vector (2,1)
@acegikmo3 жыл бұрын
the basis vector has a length of 1, but it's pointing in a specific world space direction
@bradbland93073 жыл бұрын
@@acegikmo but for that step particularly I’m having a hard time wrapping my head around how multiplying the local space point by 1 ever does anything but give back the same local space point...so if the local space point was (500,300) you already have the vector... I’m hope I don’t sound too stupid because maybe I missed where direction factored in here
@acegikmo3 жыл бұрын
@@bradbland9307 because you're it just multiplying by one, you're multiplying by a direction vector with the length of 1, which could point in any direction so effectively what you're doing is getting the basis vector (in world space) scaled by the corresponding local space coordinate, to get a world space offset
@bradbland93073 жыл бұрын
@@acegikmo I think where I get confused a lot is thinking that the values in a direction vector are 1 but it’s the length of that vector that’s 1 unit in relation to the units in the space your working with ... Is that correct?.... Btw thanks for your response
@acegikmo3 жыл бұрын
@@bradbland9307 kinda yeah, though in reality it's a little more complicated, but, kinda yes~ (hard to elaborate on my phone in KZbin comments, but you're welcome to join my discord and ask in there!)
@primitivepatterns3 жыл бұрын
@2:20:36 anyone know where I can get one of these models of the axis origin cursor thing?
@acegikmo3 жыл бұрын
not sure, I 3D-printed and painted my own!
@primitivepatterns3 жыл бұрын
@@acegikmo I figured it was something like that :) It looks so good btw!
@voidconcepts Жыл бұрын
Example? If you're making an AoE and you want the Aoe to align with a sloped ground when a player casts it. Edit: Not even 5 miniutes later. @ 2:30 Lol, I know where this is going.
@Seanmcfarlane1153 жыл бұрын
Great stuff but the cat's really distracting. Give Thor some kibble or something to keep him busy 😛
@exlpt2234 Жыл бұрын
He’s just a bean
@JonathanAnima Жыл бұрын
Perhaps with a little bit of catnip...hahah
@BlackOps783213 жыл бұрын
Basically this shows understanding 3d vectors, view transformation, etc. is vastly more important in the real world (infact you might not even need that last part, many things just set up 3d/2d for you). If you ever got a degree from some university, they probably tried to ruin your mind with stuff you won't remember like memorizing derivatives and integrals, yet it's only important to know what those are and not the memorization. I agree with how to use these concepts, and as self-taught it's always been easier to understand what things like lines, rays, shapes, etc. are doing. Redoing the math isn't needed because many renderers can just do it for you already. Memorizing things like laws of SIN/COS and shapes doesn't even matter because those are referencable, just like everything when you make a real application of math in programming. I even find myself looking up references even in common things like web programming. However if someone were to just not know these concepts here, they'd have some trouble with C++ and getting things to work how they want because vectors, magnitude, and those things need to be understood at least.
@thearthurcarmo3 жыл бұрын
About Asgmt. 3 solution (Space transformation): I've had to take some time to figure out where the coordinates of the local space origin were coming from, as I'm new to programming, and Unity, Godot, and all this all environment. After a while I've noticed that it was given by the transform.position of the object the script is attached to, right? So I've got confused by variables' naming: What I think should be named "worldOffset" is the transform.position of the object itself, isn't it? What you've called "worldOffset" is in fact the Vector2 value we want to be drawn in the local space, the one we give the coordinates in the Public Vector2, am I correct? I think it would be better for understanding if this Vector2 was named something like finalPt or resultPt. What do you think? That's just a kind of a suggestion, as I'm just learning this through your amazing courses and could've gotten it all wrong, haha. Thank you for the amazing classes. The course is very exciting and fun to watch. :D
@APaleDot3 жыл бұрын
She called it worldOffset because it is the difference between the object and the point in question expressed in world-space coordinates. What I mean is that the coordinates of the worldOffset vector describe a certain combination of the world-space basis vectors. The process of transforming the point from world-space into local-space is just the process of expressing that worldOffset vector in terms of the local-space basis vectors rather than the world-space basis vectors. Conceptually, the worldOffset vector and what you might call the localOffset vector are the same vector, it's just that they are stored in the computer differently because one describes a combination of the world-space basis vectors and the other describes a combination of the local-space basis vectors.
@Internet_Enjoyer Жыл бұрын
wow this could have been shortened to 20min, super tedious for my taste, even from a beginner's perspective
@genosyde782 жыл бұрын
미모와 지성을 갖춘 개발 여신이 나타났다
@aaafin3 жыл бұрын
Meow on 1:48:21 :)
@madhavap28063 жыл бұрын
🙏🙏🙏🙏
@bumblebee4543 жыл бұрын
This is called 'Spaces & Cross Product: Math for Game Devs' but you don't provide the math for the cross product?
@acegikmo3 жыл бұрын
because 99% of people watching this will use an engine that has a cross() function built in, so it's not exactly necessary but if people want the math you can totally look it up! it's everywhere on the internet~
@autogenes3 жыл бұрын
noice
@ibrahimokur4169 Жыл бұрын
Matrices and cross product to complicated
@Haapavuo Жыл бұрын
Great video, thanks, but dang your cat is annoying 😅
@playdarkion2 жыл бұрын
Wtf i thought i hated math
@theeel89814 ай бұрын
So did I, but I think it has to do with giving you an incentive to learn it by seeing it in action.
@devil2005iscool Жыл бұрын
you are so cuteeeee
@Леха-в8у3э Жыл бұрын
She is so cute
@jelly.2129 ай бұрын
He
@The_Loose_Fool3 ай бұрын
RightRightRightRightRightRight So many "Right?" that it makes me sick
@ThoughtsOrange2 жыл бұрын
i want to put that cat in a bag and play football with it
@saiyanpridezbudokitenkaich34443 жыл бұрын
Is she shy to look straight into the camera lol. I was making sure she isn’t talking to my chair.
@quinndelcarmen13843 жыл бұрын
she's looking at her screen. you know, where she actually draws the matrixes and numbers, which is hard to do when you're looking at the cam instead >.>
@saiyanpridezbudokitenkaich34443 жыл бұрын
@@quinndelcarmen1384 still even when she wasn’t doing anything
@trackhero27143 жыл бұрын
@@saiyanpridezbudokitenkaich3444 lol....the camera is on an angle so why would she turn around and face it? thats so random dude. this isnt a news broadcast. When shes not "doing anything" shes probably looking at the diagram and figuring out what to explain/draw next.