Math for Game Devs [2022, part 8] • Trajectories & Derivatives

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thank you they're actually two cats in the frame right now so there's toast and then there's Thor he's in the cardboard box he's it's very hard to see him because he's very very dark uh but if we do this can you see the boy you see that little boy oh oh no toast don't don't ruin his moment he's having a moment didn't they okay Thor looks suitably awkward um okay where where was I what are we doing where are we going to talk about trajectories um here's something um I feel like we should talk briefly about derivatives before we talk about trajectories well what do you think about that any opinions I think that would be useful specifically when it comes to this but I don't know if y'all are like super maybe you're super familiar with derivatives already I don't know um where are my glasses I need my glasses foreign toast okay hey what'd you do hmm all right okay all right reacts to the discard message if you're present especially especially if you're tired you should react with a salad you would okay um some of you were doing a fire drill was that is that done are you all back back in class now what's what was going on someone typed in chat like one of my students typed in chat just the fire alarm has gone off at our site and I'm like oh at the school and they were like yeah at the school but I'll watch through my phone it's like okay just imagining someone standing outside of the building on fire um watching math on their phone it's very good mental picture um okay all right um so now that you're all here um should we look into derivatives I feel like we should but I wonder like how much do you remember from school like should we not talk about it or well what do you think because I could just use derivatives and not explain more than that or I could do like a little I guess I could do a repeat um yes please do explain okay um all right then then we can do that all right so then we're going to do derivatives and then we're going to do trajectories I just need to make sure my cats don't Escape I have a window slightly open and a very heavy thing blocking the window they should be able to get out they shouldn't be multi but if there's a very exciting bird out there they might Force themselves and that would be bad um explain what derivatives should we should we do that I think we're doing derivatives right if anything it's going to be a refresher there's been a lot of Refreshers and I guess even if you already know about derivatives maybe it's it maybe I'll have a different perspective that might be useful regardless hopefully um okay um let's see where do we start this I think it's best to start this in unity I think that's how we're gonna do this uh can we get some assignment explanation on the assignments later uh yes definitely um so today we're just going to talk about two topics it's going to be derivatives and trajectories and that's going to be this morning um and I don't think that's going to take super long I think that's going to be maybe two hours um and then um after those two lectures I have no plans um except I want you to work on assignments and for me to be available to help you um for the rest of the day I could just stay on stream for a little bit longer if you have questions about the assignments I can totally clarify some of them um yeah so so we can do that right after derivatives and trajectories just remind me and I will and I will do that I might forget and so so help me remember um okay all right I'm trying trying to figure out how much we should talk about graphs right we should probably talk about graphs okay all right so um let's open our Unity project we're gonna need that see it's like when you're a hermit like me where'd you stay indoors all day and don't talk a lot then um doing lectures where you talk for like six hours non-stop several days in a row my throat is actually hurting today oh geez I don't know I was not built for talking um okay where's our where's our Cube we had a cube let's bring back the cube okay um so we were previously looking at like Point motion or like simulating a single point um and um basically animating the velocity of some object so that it moves along some direction right um I'm just gonna revert this code to basically go back to what we had before uh this was the fancy smooth smoothing movement uh but we're gonna we're gonna revert this one um you might need gizmos uh so I'm just gonna remove all of the smoothing on this Cube and go back to our very basic uh thing where we just specify you know what let's just do a single value um so this is our velocity we're just doing velocity along a single axis right a one-dimensional velocity um so we can do nope I'm tired okay don't don't judge me so we're just gonna move along the x-axis um let's just do that we're gonna need it in multiple places um okay silently judging me oh no uh all right so now we're back to our very basic code we specify a velocity um and then we move the position by our velocity multiplied by time dot Delta time because we want this to be frame rate independent so this is something we looked at yesterday um just a very basic setup we then press play and then we set the velocity to some value like one or negative one or negative two or four or one or 0.5 whatever we want so this is basically um determining the the um the velocity of the object right and currently just along a single axis um so one thing that we've done here is that um this is simulated on a per frame basis um we don't actually have a function that represents the entire path of this object right like if you imagine a a trajectory then that's kind of a predetermined path if you have a simple like gravity model um and so you can also do this type of movement using a function of time right um so let's let's try doing this um using a function instead so this is the function for the position where the input is time let's just call it t um so now instead of setting the velocity we're going to set the position directly based on a function um and so instead of using Delta time we're going to set the position as in we're going to use equals directly so new Vector 3 we just have an x coordinate here so we're going to get the position over time dot Delta time or sorry time dot time um I guess I could return a vector 3 just for convenience or no no let's keep it a flick never mind foreign so this is effectively the um the X position right um so now we can Define the position of this one as kind of like a math function right you have an input of time and then you output a coordinate right um and so so now we can write this as for instance we can do return um let's see so what would be a good math function Let's see we do um just return time just returning time immediately so if position equals time um then it's kind of like we're mapping time to the x-axis so time is just going to be it's going to move one meter per second to the right so if we recompile this and then fix our I was considering saying like oh what if we do what if I put on cat ears as soon as I make a mistake but then I would wear like eight cat ears right now so that's that's not a viable option so now hit play um it is now moving there you go it started at zero so it moved from the um moved from the start of the or from the origin of the world right because we we didn't really ask it to take its original position into account but now it's moving one meter per second based on our math function right but maybe we wanted wanted to take the start position into account um so let's do start position let's just set it in awake and then we do start position plus our movement function then hit play and now it starts from the position that we wanted it to start from right um okay so you can see that it's now just moving at one array to one unit per second but we can of course modify this function um so if we do 2 times T um it's going to move twice as fast um and if we do 10 times C it's going to be 10 times as fast if we do negative 1 times T it's going to move backwards um by 1 meters per second um and so the value we type in here is actually our velocity so we can bring back our velocity variable and just multiply it there if we recompile we can set the velocity to five and then we press play and now it's going to move faster however this time the velocity is fully predetermined so there's no State for the position of this this is always recalculated so now if we lower the velocity instead of one it's going to move back because this is now a predetermined path instead of a constantly updating value we're not modifying the position we're directly setting it based on a math function right um so this is kind of a different approach to animation so this one is fully predetermined um it's not like simulating something frame by frame um and this kind of like um this kind of explicit predetermined animation um if you saw my like math videos that I had a lot of animations in those are all using this type of predetermined animation um so the the downside is that you can't modify velocity at runtime because that modifies the entire path um but the upside is that you can get the position at any time value you can just sample it and you will know the answer um okay so maybe we want to make this movement a little more interesting let's let's use a different let's modify this function a little bit more if we um if we add um T times T so now we have time squared and then multiply that by some value um let's say let's call it value just to be a little sneaky about it so now we have t squared multiplied by some value okay so let's set that to well it's going to start at zero and that's fine there we go and then set velocity to one and now let's add value to 1. and so now this Cube might be hard to tell let's restart um sedative one see it's slow in the beginning and then it starts to accelerate and then it's going to move faster and faster and so what we've done here is effectively we've factored in acceleration into our function um and so acceleration is a little bit sneaky because this has a factor of one-half um and and so so technically this should be 0.5 times um our acceleration value okay um and so this is a very very very basic uh formula for position over time where you specify acceleration and velocity um and so so this kind of function right here we can actually visualize this in the way that most people visualize things is using graphs uh there is a website that is super useful for this I mentioned it once before on this class I think so there's a website called Desmos desmos.com calculator this is a super useful online graphing calculator um where's my there we go okay so here we can actually visualize these functions um and so in this case if we imagine the x-axis being time we can kind of write our function here immediately we just had um this was just our starting points um so actually this tea should rather be X in this case if we want to do much um but that's our input value to the function and in this case it's time right um and so this is just moving one meters per second so on the x-axis we have time and on the y-axis we have distance how far away it's moved so it's really important to remember remember that the y-axis is the value we get out of the function the x-axis is the input to the function which again in this case is just time in seconds so where it says 2 that means two seconds into the future it's going to be at the value above that number and so when we added a a squared like times squared then we get this accelerating motion um so the um so so that with this you can basically control the um the speed and the the velocity and the acceleration but with a function like this you might also you might also want to know like what is um like let's say you had a more complicated formula um and then you just want to know like what is the um what is the velocity let's say we didn't have a velocity parameter you just had a different formula then how would you calculate velocity from that formula um then generally that's what a derivative is a derivative is the rate of change of a function um and so so if you have a um so if you have a graph of some function let's say we do um five x squared let's say this is our this is the the equation describing the motion or maybe maybe something a little bit a little bit more complicated so negative 2 X Plus it's a 5 squared maybe this is our weird weird little motion path right um so remember the y-axis is the position and the x-axis is time so this one would move backwards in the beginning and then which would start moving forwards and then it would start moving forwards faster and faster um and again we can just shove this in like try it out directly so we have negative 2T 5T times T so that's t squared um so we can just test this function um so if we go to Unity and hit play we are our cameras who knows where um um oh this is going to move really fast uh we're gonna have to modify this one let's do let's do this function instead negative 2x plus x squared okay so we're going to do this function now so we compile and hit play now watch the cube going backwards and then forwards right so backwards and then forwards and so so that's the graph we're looking at here that's the exact same function remember x axis is time so if you imagine um um you can sort of imagine this line as your time parameter so as time moves on and moves backwards and then here it starts moving forwards again and then here it's starting to accelerate forwards even further and further and further right does that make sense graphs can be a little bit confusing because you don't have X and Y axes really um why 0.5 for acceleration we're going to get to that um those spoilers I shouldn't have mentioned that um so remember that the x-axis in this case is time and the y-axis is the position along the x-axis excuse me um okay so um and so so maybe maybe you want to figure out like what is the um what is the velocity at any given point because now we we just have the position um along this whole thing but how quickly are we moving like here or how quickly are we moving over here or over here like how do we figure that out and that is exactly what derivatives are they are they are a function that represents the rate of change at any given point um and so um where's my button um so if we have our our function for position um let's call it P usually you write functions as a in a parenthesis like this where you have your input value um in this case our input value is a Time Value right so that's I could just call that t ons some position over time um in this case is negative two X Plus x squared so that's negative 2T plus t squared and so this gives us the position but then if we want to get the velocity somewhere um then we need to differentiate this function and to differentiate is the act of figuring out what the derivative of another function is so we need to differentiate this in order to figure out what the velocity is um and the velocity or the derivatives are usually denoted using a little Prime function or a little Prime marker here so if we want the derivative then how do we get the derivative of this function and remember this is the velocity in fact I should I should color code this so that's the velocity and and I should also do um what it's in this position and then we have velocity um all right so we have the position over time and then we want the function for the velocity over time um and getting the derivative of a function like this it's actually pretty straightforward um this is a this is called a polynomial a polynomial is basically when you have um some constant um plus another constant um times x plus another constant times x squared plus another constant times x cubed and so forth right um so so this is the format for a polynomial uh these are used a lot in many different functions trajectories are also polynomials bezier curves are polynomials a lot of things are polynomials so this is just kind of the the basic format of of this type of function um let's actually also color code our input variable because that's going to be important a little bit more readable um okay so the rules for differentiating in order to calculate the derivative um it's generally that you take the exponent and multiply it ahead of the the thing itself so so if you have t to the power of 5 the derivative of this if we differentiate this one this would be five T um to the power of 4. and so this rule follows for for each term so when you differentiate a polynomial you just differentiate each term separately so we have negative 2T and then t squared right and so this rule you can just use that for anything like as soon as you have a some your your dependent variable teeth to some power um then this is the rule that you follow so if you have let's do another one so if you have uh three um tea uh three T cubed what would that be quiz go go for it see if you can figure this one out I'm gonna like awkwardly wait for someone in class to raise their hand 16 yes um so we multiply down the exponents so 2 times 3 is 6. um and then it becomes uh just t uh to the power of one which is the same thing as the value itself right um as I went up with 16. um and then we can differentiate that again if we want to and this one um now T is T remember t to the power of one but then if we do T to the power of zero that's what it would reduce to right um so it's going to be a c 6 t to the power of zero but anything to the power of zero is one so we're effectively just multiplying by one here so it's just six um and then we can differentiate again um and when you differentiate a constant as in there's no dependent variable here um or independent variable one of them whatever there's no T um then this just becomes zero um and so so this is is like 99 of the time where I need to know derivatives um I just have to remember this rule but that's it um so you you plop down and multiply with the exponent reduce it by one and then continue like that right um now remember that this only applies to your input variable because we're differentiating with respect to time sometimes you have constants here um so if you have a constant that's like C or let's call it let's call it a um e to the power of 2 or whatever if you differentiate this it actually becomes zero um because it doesn't depend on time right this is just a constant um and so that also becomes zero um so so you need to remember that this rule is specifically um for the um for the input variable of the function okay um all right so this is this is like how you differentiate simple like polynomial expressions um so now we have the tools to differentiate this right now we can figure this out um all right let's do term by term so negative 2T but will become negative 2. because t to the power of 0 is just one so negative 2 times 1 is negative two and then we have t squared and that will become plus two t and now we have our derivative we've now differentiated the function for position and we now have a function that represents the velocity at a given time um and that's kind of cool isn't it like now we're just like we have this math function and all of a sudden we can get this like very physical quantity out of it which is the velocity um and so let's let's implement this in decimals just to see what it looks like and then see if our cat is eating cables hey salad do not see I let them chew on literally everything but I don't want them to chew on cables like it's I'd rather have them chew on my foot than cables okay this cat is being being a boy I don't want him unplugging our getting electrocuted salad let go let go this boy this boy okay yeah you're in quarantine also salad here where are you purring it's a wrong response you're supposed to be gumpy you're supposed to become um okay how do you swap between the two colors in Photoshop um you know hey what what um you know I used to use the Color Picker um but these days I have a stream deck and so I pick colors from that so I just set up my colors and some brush sizes and and whatnot um so that's that's how I do that Color Me impressed good one oh he's so cute it's so tempting this is why he's an because he's so cute he can just get away with anything okay salad you know I was gonna teach math you're kind of occupying my tablet now um okay let's let's see if we can continue regardless hey hey hey okay okay so the hey okay what what is up with you can you not just chill you have to eat everything but solid right here well did we go for a break now already we're five minutes early for prey but salad seems to really want to or I should just eat them out of my chair but okay let's flip you at least there we go how about that now you're a little bit further away um okay so um so now we have a now we we just differentiated this uh position function so we had a function representing position over time we differentiated it and we ended up with a function that represents the velocity over time um and so so let's see what that looks like so negative 2 plus 2T all right so let's follow our color scheme I guess uh let's do the position in black and do the derivative in red um what okay so our derivative is negative two plus two x okay and so this one might take a while to parse because you need to kind of figure out what it even represents right um so remember that X is time so time is moving to the right here um and then the value the y coordinate represents the velocity and so the velocity is negative here and so um negative velocity here means that we're moving backwards right and you can see that the function goes down that's why the velocity is a negative but then the velocity is actually speeding up right it's getting closer and closer to zero um and so so you can see that or it's rather it's decreasing but it's decelerating towards moving towards a positive direction um and so the velocity is going to decrease more and more and more and more until it hits zero um and so you can see that where this one is turning around because it's slowing down and then turning around that's where the derivative is exactly zero um and so so when we hit play in unity it's going to move backwards first right a zero and then it moves forward um and so that's our that's our velocity and then now we can bring back our velocity vector we we showed the velocity here before right um so now and draw the velocity again um spring pack that um and then let's show the velocity vector and so the function is negative two plus two x so negative 2 plus 2 times x in this case X is time right um and so now we have our velocity and now we should be able to see the velocity again um wait oh because it's using the editor time I was like why is the why is the velocity drawing and I'm guessing it's it's because it's in on drug gizmos time.time is actually running um but if we restart the game or just start thinking um I have the game paused now and you can see that it's backwards already so that means the velocity is negative one and then if we hit play because it's moving backwards and then it's moving forwards again and so that is the velocity we've just calculated the velocity Vector just purely from um differentiating our function which is kind of neat isn't it um and so so one of the really powerful things about this is that um you can get a lot of properties out of your function like this um like for instance what if we want to know uh where does the cube turn around um because what if this was a more complicated function um then I don't know maybe maybe we had variables for this instead um so um like if we had had 3.3 or something um like let's say we had a function like this um actually let's give it a variable this is how Unity calculates a rigid body velocity um no because unity's rigid bodies are not um they're not predetermined right rigid bodies simulate uh frame by frame and that they have to do that because they have to react to the environments right um yeah um so so we can replace a lot of these things with the with variables right so maybe we can do ax plus uh b x squared and then we had some variables for that um so now we can we can tweak this function to however we want it to move right and then if we want to do the derivative of that remember A and B are constants um so we just treat them like any other number um so then the derivative is going to be a plus uh 2 um 2 b x and so again you can see that whatever we set this function to the velocity is zero where we have our what's called a local minimum and this is where the cube turns around right um yeah and so if you imagine then maybe just maybe let's say this is a trajectory and you want to figure out um at what point is the maximum of this trajectory like you have a function describing a trajectory and then you want to know what's the maximum here like what is the maximum height that we're reaching given some initial conditions then we can actually use the derivative directly if we use the derivative then if we just calculate where is the derivative zero then we get the time value at the peak of this of this trajectory right or and it doesn't have any any trajectory either it could be any function right because now this is just a function um salad is also a function of time okay are you done are you done okay um and so um now that we have this arbitrary function we have we have a a simple function of ax plus BX squared um where we can modify these and we can get the derivative immediately by just following the same differentiation rules um and we can figure out where is this peak but then how do we actually calculate that um well we can just write our function so this is our derivative right this is our velocity if we write that function and set it to equal zero so we want to figure out what when is this equal to zero and so this is kind of just basic algebra we need to figure out we need to solve for x to figure out where is X um where is the Y value or where is the velocity zero and so we just set the velocity to zero here and then we solve for that so we subtract a from both sides um and then we divide by 2B and now X here is the time at the peak of this function because we just all we asked for was when is the velocity zero which always coincides with this peak where it turns around right so even if we if we modify these values now um you can see that the velocity is always zero at the peak and then we get the exact time value where we are at the peak um and so it's so it's a very useful tool it's it's incredibly useful whenever you have a polynomial or something else that you can differentiate really um and you want to know where is the peak uh or maybe you want to know uh like where is the the valley then it will it will do the same thing it will just know uh it will just give you where the um where the velocity is zero which is always at a peak or a valley right um yeah so those are just some of the the like more useful use cases of um uh derivatives and that's pretty much the only use case I've had in Game Dev for derivatives is figuring out like trajectory um extrema values or getting the or differentiating trajectories um and for splines um so splines are usually polynomials um and so there's a lot of useful math you can do there if you know the derivatives of these points um and you can actually do the same thing for um bezier curves um and so so let me show you what that looks like I need to drink more tea okay where do we do this where do we do this okay so for example so here's a um here's a set of bezier Curves um so these are just the the same bezier card we did before but they're just connected and that makes for a cubic bezier spline um and you can write the formula for the bezier curve using matrices which is a very useful way to write it um and so differentiating this is very easy you just differentiate the Matrix here because these are the only values that are dependent on um the T value or time right and so now we can actually get the derivative of a 2d function because remember this gives you a 2d coordinate given time but what we've been doing so far here is just getting a one-dimensional position right because we're just moving along the x-axis but you can do this using 2D functions as well um and so you can just get your velocity acceleration and jolts directly from differentiating um and you can actually draw that graph as well so if you look at the um derivative of this bezier curve or the the set of bezier Curves um you can draw the derivative as curves too if you remember this is the velocity Vector it's kind of the motion of this object as we Traverse an increase time along this path and so the derivative again instead of just being a a simple graph where the x-axis is time we instead have X and Y coordinates of our um X and Y coordinates drawing a curve in 2D space right and so so this is literally showing the derivative of the spline um so we're kind of doing a similar thing here um so it's a lot of things related to splines are useful when it comes to derivatives um that's a little bit outside of what we we should talk about um okay and then let's click in Photoshop and if you click in Photoshop it does this and then if I tried a pan it does this because I'm not using my tablet I'm using my mouse because Photoshop is just a great piece of software um and now we're going on break so dude let's do a 10 minute break resuming at 10 10. oh I really need a drink and they're charging you for Pantone colors it's so dumb okay how's the YouTube channel been doing I haven't I haven't looked at YouTube chat uh there was a super chat oh uh still in my history uh what theme are you using on writer uh fascinated by your content keep up the amazing work thank you um uh I'm just using the default writer theme I think I might be using the one called Visual Studio dark maybe um the only thing I've changed is that I've changed the background to my my brand color background that I use in my videos um but that's basically it so I use the same color for um the background of my videos as in my code did you see the unity announcement that they're adding a spline editor uh they've had a spline tool for a long time now right the um the spline package um or is that a separate thing I've been working on a spline plug-in so I hope Unity doesn't make a good one try to take your scribbles making it a two-screen desktop I did this in paint but apparently trying to duplicate and use the background color crashed my paint three times oh that's weird it's a new spline thing more built in oh is it unrelated to the package that would suck that would be the second time Unity does a thing that I really was I was super excited to make a plug-in for as far as you're aware it is okay um oh it's bad that's my selfish opinion then I can make my plugin anyway okay foreign guess I hadn't come that far in my spline plug-in anyway but still annoying Unity stop stealing phrase plug-in ideas challenge I guess a spline plug-in isn't that um isn't that unique but um I guess the yeah hmm I don't know the thing is that like most people when they Implement splines is that they usually don't implement a lot of those planes um the um like quite often they they Implement just like busiest planes and then they leave it at that um and so I think the I think the unique thing about my potential future plugin is that it would be well way more than that um and so it would be like um busiest blinds you'd have hermite splines you would have Capital rum splines oh yeah Capital ROM they would probably implement that um so Kevin ramsplains and uh bee splines but then also all the variants of those like nurbs um and the non-uniform hermites the non-uniform bezier the non-uniform capital rum like there are many different types of splines and I think implementing all of these is actually kind of complicated especially if you wanted to be intuitive and useful and good and performance and so I think I think I I want to make a plug-in for that and I've been researching like splines for the past year and so I'm hoping I I hope I have more knowledge than some engineer at Unity who was like thrust into making this at some point and so so I'm sort of just just hoping that I've gathered enough knowledge to make my spline plug-in um more feature-rich when it comes to different types of splines than any other spline plug-in that's my hope at least um yeah um but who knows I'd make this plug-in anyway um yeah maybe I'm not sure yeah it's there's way more competition there's there's more existing spline plugins uh than there was for like shapes shapes was more of a unique um plug-in I think so I don't know what the market would look like for that um okay uh Thor wants me to sit next to him so that he can eat as I'm gonna look at salad so I'm gonna sit next to Thor um he needs a snack buddy I don't know why but he needs a snack buddy oh I need my tea I need my teeth foreign oh damn keep playing okay is salad fat I'm a little worried I'm not sure if he's fat you say just fluffy or fat or both like it kind of looks like he's got a bit of a flab of fat and he's lying down okay fingers toast is napping in there now what what uh uh what's the name of the bezier script um I think I pushed it to the Repository um it's a good question what did I aim it uh lerp test is the bezier script obviously you know um I thought I pushed that it should be push um I was outside of scripts oh because I am lazy um yeah I should have just moved all of that in um you know what let me just move move all the scripts and and I'll push that actually I can't see that with Cube mover yet um or I can I can do that uh I did not mean to do that okay I'm gonna push that [Music] um math function Cube movement there we go you know what I'm going to rename lerp test to bezier oh I should have done that in writer okay okay I push it now now you should have everything in the correct folders hmm usually I'm in my projects I need to drink water um and so that's why my my throat is very sad right now um so usually in my projects I have the um um I usually leave scripts out in the root folder to mean that they're unsorted and then I usually have folders for different like types of skirts um [Music] and so if if a script is just lying in root that means I need to move them into a folder um it's the way I work at least but in this case there's just one folder so um okay all right um I think we're ready to resume a little bit over time um show your presence react okay all right um so let's let's do one more thing with this um before we move on to trajectories um and so so if you then want to go one step further like maybe you don't just want to do position and velocity what if you do you do the derivative one or differentiate it once more uh doing that um then again with the with this notation it would be p and then double Prime of t um colors are great um so if we differentiate this again we just use the same rules just repeat the same rules uh that was the Hat here right so this becomes zero so zero plus and then two t will simply become two um okay and then this is the acceleration uh uh running out of space oh no the bezier Curve we're gonna make you smaller okay so now we can calculate the acceleration of this object right um so now we've gone one step further than velocity um and so we can visualize that too um can do that in a graph if we want to so we have the um this is our um this is our position this is our velocity and then our acceleration is just differentiating this once more right and so a is a constant so that's going to be zero and then it's plus 2B so 2B is going to be the um uh are acceleration and that's just a constant in this case our acceleration is just straight up a single value right it is two times our constant B that's our acceleration um and so if we depending on the shape we have here we have different acceleration values but the acceleration is the same and it's the same acceleration across the entire curve it's just that the velocity starts out as negative but then the acceleration moves the velocity to become more and more positive right um yeah and so so if we modify the acceleration if we have positive acceleration um we have a local minimum here if we have a negative acceleration we have a local maximum here so then it's accelerating backwards um yeah and so those are kind of the relationships between all of these different functions um and then obviously we can we could differentiate this once more um so if we differentiate it again in this case it's just going to be zero right and every other derivative after that is just all going to be zero um if you want to get esoteric this um this also has a name um so this would be P triple prime so this is called um jolt and so jolt is also jerk but every time I call it jerk um people make comments about it because it's very funny um but yeah it can either be called jerk or adults either of them is fine um there are names for the rest but nobody uses them pretty much you only use the names for the first three um and then you just say the fourth derivative of position or whatever um yeah another thing on notation and once you get into like very high derivatives like this sometimes you will see the notation of p and then a parenthesis with a three inside and then the T value here um so sometimes you just see a number like this um yeah just a just a heads up um all right um okay all right um I'm trying to figure out if we should yeah okay let's do that let's actually solve this um so now we've been talking about trajectories right um and what do we mean by trajectories really like that that's kind of a special type of function right um and so um so maybe maybe we can actually derive what that is right um so so let's let's see if we can figure it out um so usually you would you would Define a set of parameters like these are the conditions that I want and then you can solve an equation from that right um and so so if we um let's see so so in this case we started out with a this is called a quadratic function um or a quadratic polynomial it's called quadratic because that's the uh the biggest exponent of our time value that we have if we had another one that was to the power 3 this would be a cubic function and so forth um or if you added power 12 it would be a dodecic function or just you just call it a degree 12 function um so there's actually one more factor that we could add here because we don't have a constant factor and we could have a factor here that is in this case was just zero so we could just set some value here that would basically be an offset for the entire function um so we haven't added that one yet so we could could have that if we want um so I'm gonna I'm gonna rename these so I'm gonna call the first one a now we have ABC um so we have our function as usual but now we have our function a we can vertically offset our position if we want to we're just just offsetting it right um okay and so so the um these are now incorrect because I swapped the variable names um so this should be B and C and this should be C I believe um okay and the um the vertical offset here um you can see that that doesn't affect the velocity or acceleration at all right which makes sense because if you differentiate a function um that has a constant that constant is just not going to exist in the uh derivatives after that right um and so so this is kind of this format up here um like a plus b x plus c x squared this is a like kind of the canonical form of a quadratic function in this case that's a quadratic polynomial um and as you can see the uh this shape is actually called a parabola and trajectories are parabolas um but usually you don't really Define trajectories using um using values like a b and c and whatnot right and usually you want to have a bit more of a tangible approach to this um you want to you want to Define like here's my starting point here's my starting velocity here's my um here's my acceleration and so that's what we're going to do now we're going to derive um the function for a trajectory and so let's just let's just set up our parameters um so at let's say the function of position we don't know this function yet we want the um position at Time Zero we want that to be the starting position right um so so what do we call that maybe P0 or something um that's that's an okay name let's call it that um and then we want the um the derivative in other words the velocity we want to give it a launch velocity like if you imagine a a turret just priming that if you imagine a turret firing something then maybe you want to set the velocity of your projectile right so you want the velocity at Time Zero to be a specific value um so we're going to we're going to call that V zero that's the velocity at Time Zero and then we need some sort of acceleration and if you imagine something like if you have your your turrets and it fires something like this right then you have an initial velocity so that's going to be v0 uh let's actually color code this here we go um uh then we have an initial velocity and we also have an initial position right the starting position here is P0 but then we also need um something that will change the velocity because remember um if if velocity is just left to its own devices it's just going to continue straight ahead like it's in space right where where there's no gravity around but in this case we want gravity we need something that can pull the velocity downwards right um and so we need acceleration we need something that can change velocity and the thing that changes velocity is acceleration and so that's going to be the second derivative and here remember that when we have a quadratic function um there is no like factor of T So T it doesn't actually matter and like we looked at before the acceleration is just a single value um or the the third derivative is just a single value right um so so it doesn't actually matter if we do this at like T value zero or somewhere else if we want to use the quadratic function um but just to just to keep it consistent we can type zero here even though it doesn't really matter um and so this should be our gravity constant right um let's just move that out of the way um and so that's going to be gravity but we could just call it acceleration to be extra fancy um gravity is just acceleration isn't it um so we have a zero okay um so now we can actually solve this um so how can we solve this well we know that our function P of t oops P of t equals and then we have a few unknown variables right and so we have a Plus b t Plus um C t squared and so whenever you have an equation that you need to solve that has three unknown constants the unknown constants in this case is simply a b and c right um then you need three equations that can constrain this function and we have three equations we have three three like strict requirements for this function and then we have three unknown variables that we need to solve for and so we can kind of just solve for each of these right um and so we can go one by one so first off um I can actually keep these so we can see the process um so first off if we want the value of our position to be P0 when T is zero we can just imagine what happens if we set T to zero right if this is zero what would happen well this would just get removed because it's zero right so this would get cancel out this is also multiplied by zero and all we're left with is a and so this means a has to be P0 because we want p at zero should be P0 and the only variable we have there is a um and so we've kind of solved our first first one so we can just do this erase that and type P0 um go um all right we got rid of one um and now let's do the other one so now we want the derivative at 0 to be V 0. okay so now it gets a little bit more tricky um so now we need to get the derivative of this function in order to solve for another one of these constants so we can get the get the derivative we know how to do that now right so P0 or P Prime of t equals okay so P0 is just a constant that's going to become zero so that one is just going to get removed BT is going to become B and then plus c plus 2 C right t plus 2 c t because again the exponent gets multiplied ahead of that term um and gets reduced by one so that's t to the power of one which is just t so now we know the derivative um of this still unknown function so we want this to be v0 um when T is zero so here we run into a similar similar thing right um we we just test what would happen if we put zero here well this becomes zero this cancels out and all we're left with is B and so the conclusion is that B has to be V 0. so you can see that it's kind of the same thing happened right uh so this is just kind of the the derivative and then we figure out that b has to be um v0 okay so going back to our original equation we can just um plop that in because now we know that B has to be v0 so V 0 t Plus CT um squared all right now we have one variable left and we have one equation left and that is for the acceleration so again just do the same thing we get the derivative of this function to get the uh we differentiate that function to get the acceleration so that would be p double Prime of t um equals so this would become zero right we're differentiating now so that would become zero and then 2ct would just become 2C um and so so now we're left with this equation right here so if T is zero um but here T doesn't really matter we want the second derivative to have the value of our acceleration right um but in this case it's do we have a factor of two right and so now it's a little bit more complicated because if we want that to be equal to our acceleration um we have to take this factor of 2 into account um and so so all we need to do is to cancel out that two um by uh by setting the uh by multiplying it by multiplying it by 0.5 um and so um effectively are we doing is we're taking our [Music] um where where my colors go um so so now we know that our constant C has to be the acceleration constant um and then we divide it by 2 or multiplied by 0.5 right and so that's that's how we ensure that this function will um be a0 right um okay um and so if you want the um that might have been a little bit kind of skipped a few things I had here so so if we if we solve this a little bit more more step by step then um then effectively what we're doing is that we know that this should equal a0 right and then we divide both sides by two um there we go and so we end up with a0 divided by two and so that's C that's our constant C um okay and so so now we can go back to our original equation we've kind of done this very much step by step uh sorry if I'm bogging you down in algebra but I hope it's I hope it's a little bit more useful and intuitive to know where all of these factors come from um and so now we have our acceleration uh divided by two let's just move this around a little bit okay so this is the formula for the um for a trajectory or specifically this is the vertical position for a trajectory um but it actually works for for either for either way that you set it up um so this is our trajectory formula um that's the that's the final final formula right there um uh kind of lost it around P Prime uh B plus two c t oh this part right here um so so the what we did here was that um we need to solve for variables right we need to know what B and C are because B and C are unknown at this point um and so from here we know that when T is zero we want that equation to equal V zero right um and so if we oh you're empty Photoshop so what we're effectively doing is that we're substituting t with zero so I'm going to replace that um zero and then C times zero um and we we know that we need this function to equal V zero right and so the result of this function should be v0 and so we can just remove that and say this should be V 0. that's what that's what our initial equation said we want at Time Zero the velocity should be equal to v0 and that's our initial velocity right that's the the initial velocity of the thing that we want to launch in our trajectory um and so so then you can kind of see what happens here right we were multiplying by zero and so this entire thing just gets deleted um and so this gets just heated into infinity and all we're left with is b equals V zero and now we've figured out that constant right and then we substitute it in we we replace B with v0 and that was solved for for b um and so we're this is kind of the process we're doing uh in each of these steps we're just um just substituting T by our value zero and then we're solving for whatever happens then right um okay did that make sense and the reason a is no longer in the equation uh because that was the first thing we did the same thing with um so did the same thing here we we know that this um this whole thing should be equal to P0 at time zero right so if time is zero we need the position to be exactly equal to the starting position of the trajectory so when time is zero we want it to be here um and so we do the same thing here we um select the wrong tool and then we replace t with zero because again it's at Time Zero so we can do this so B times 0 0 squared and we know that this should be equal to P0 right we have P0 here so again the position at Time Zero should be equal to our starting position and so we we can just solve this here um do the do the same thing um the everything is multiplied by zero here right so this is multiplied by zero so it disappears this is multiplied by zero it disappears and again we know that P0 should be equal to P1 um that's that's the constraint we set up or P0 um the variable P0 sorry so now I know that a should be P0 um yeah so we kind of figured these out like one by one and then finally we did the same thing for C there we go and that's how we end up with the trajectory formula um okay so the end result is the same equation for the start just work down bit by bit pretty much yeah so now we we derived the trajectory equation from a set of initial constraints so this is the requirement that we had we wanted to specify the initial conditions right although the acceleration is going to be the constant condition because it's the same across the whole thing but we wanted the initial conditions of start here with this velocity and this acceleration or gravity and then we want the function that describes the path that that's going to take and that's exactly what we're getting here so so this is the equation for trajectories um so we're jerk the factor would be one-sixth uh yes um this actually follows a pattern you can generalize this um I believe it is uh one divided by the factorial of n um I think where n is the degree of the term um so that that's going to be the the factor in front of each initial condition I think um um yeah um so this is our constraints um and then we end up with this this where what's on what layer God damn it Photoshop is so janky sometimes okay so we got our formula for the trajectory um all right hope that made sense this is like the first time we actually did algebra like properly a lot of algebra and a little bit of calculus imagine that um okay um [Music] I presume you want to see this implemented in code right yep those are our trajectory or all trajectories um pretty much all trajectories that have a general that have this format where you just have a simple gravity constant um so um this actually works using vectors too um and so there's there's nothing um we kind of defined this using um just using a single variable but you can use this with vectors as well um and so so we can we can just straight up implement this um okay the search this are trajectories um this is a trajectory yes um remember we're setting up an initial position an initial velocity and then we have gravity right which is our acceleration um we can call it a0 to be consistent but it's the same acceleration across the whole thing when you you look disappointed that this was trajectories are you what did you expect something else or um okay so these are like initial conditions and then we solved for what that equation would look like right um all right let's implement this let's just do it in code um I'm gonna put it in the scripts folder in this time green objects trajectory okay and then we add our trajectory script then go back and forth to between unity and writer to make writer realize that the script exists okay um let's let's now set up our trajectory trajectory um so we want some way to get the initial position the initial velocity and the acceleration the acceleration is relatively straightforward if we just want to use unity's acceleration um we can just Define that here um let's call it let's call it a just to be consistent let me a zero or maybe acceleration so this is just physics dot gravity because gravity and unity is a vector so you can set the gravity to points in any direction and any magnitude and so that's our acceleration uh and then and then we need the um we need the initial position right so the initial position I should probably say start position or or just position maybe that's okay that's going to be transform.position because I just want to be able to move this around in unity to easily test this and then the velocity that's kind of up to us how we want to set that up so maybe I want to maybe I want to launch it along the um x-axis or the z-axis I guess either is fine let's do the x-axis so I want the x-axis to be the direction and I want a um I want to be able to specify a um parameter for for the launch speed and so so maybe we'll make that a public property or maybe maybe we'll make it a range um so launch speed and so then our initial acceleration or sorry initial velocity vector uh that is going to be transform dot right which is the again the this axis right here the red one um and we multiply that by our launch speed all right um and then we can just Define um we can just write the equation so so public Vector three get points over time and then we do return our initial position plus our velocity times time plus our acceleration divided by two times time squared I believe that was our I believe that was our trajectory just gotta double check yes so there's a there's a factor of uh two here that we need to keep in mind um and so that's the that's the equation for trajectory now we can get a point in a trajectory over time where we just supplied that the time value here and then we get the position um but we might want to also be able to draw this um so we could go back to our trusted androgismus um uh and then we want to draw this trajectory over some span of time um so probably easiest to use is the either just draw individual line segments or we can use a polyline um either is fine um you can use the polyline this time because it's it's cute um okay um so then we can just like specify how detailed we want this curve to be because if we're drawing it as individual lines we could just subdivide it however much we want but maybe that's a bad idea um so so let's just set it to some some reasonable number maybe 80 80 or something let's call the detail all right and then we Supply the points to this list [Music] um and that's uh the T value is going to be um I divided by detail minus 1. as a flip so generally if you want a percentage of like a value representing a percentage of a for Loop if you want the last iteration to hit one exactly you have to subtract one for your account if you wanted to not hit one then you would omit that and cast this to a flute um so generally you would do this for things that are cyclical like when we were drawing our clock um then we don't want to have two samples at the top right we only want one sample at the top when we're going all the way around the circle um but in this case we want to go and go to exactly one because we have two end points right so we need to reduce the detail by one that's a float and so this also castes to a float um just a classic off by one thing to keep in mind um okay uh and then we we just uh we can clear this first and then we do we add a point in our list of points um and we add get points at time t and so now this only goes from zero to one now so this will show us the trajectory over one second um so we could add a add a thing for for the draw duration as well for the trajectory just in case I want to draw it for for like how far would it go in in three seconds or whatever uh so then then we can just do floats time equals T times draw duration and then we'll pass time into get points and then we need to draw the line we we've just uh specified points and there is a handles draw a a polyline um why does this only take an array that is dumb it should be able to take a list um well whatever we'll just do it manually I guess um what list.2 array I mean you can do two array um the thing is that I specifically wanted to avoid allocations and that's why I used a list that's defined outside but if I do two array I'm going to allocate every frame and I'm going to just generate garbage um and so so that it's I don't want to generate garbage I've become very sensitive to that as of late that's why that's why I'm not doing new lists or doing conversion like that but okay let's just let's just draw let's just do the regular gizmos I draw line um okay um cool so all we're doing now is we're sampling our trajectory along 80 points from zero to draw duration and then we're drawing lines connecting this so now we're basically just drawing this function um yeah that should work let's see if it does we do have a trajectory look at this little little thing let's increase our launch speed that's a that's a trajectory right there we can we can rotate it and we can see that the trajectory is updating move it around the origin changes and it's working and so this is using um so now we basically defined a trajectory um using a predetermined path um and if you were to um actually let's do that in practice let's actually let's actually make sure that we got this right I'm gonna I'm gonna create a rigid body um and uh we're gonna make sure that the rigid body matches we're gonna add a cube um and then let's let's make it a little smaller because it's a very large Cube um a little bit smaller okay let's add a rigid body to this one um and then in our I guess it could be a child object trajectory um in a wake we're gonna we're gonna throw this rigid body so we're gonna do rigidbody dot velocity equals the velocity that we Define in our trajectory so we're just gonna we're gonna set the Velocity in a week and then this rigid body should follow exactly the same path um and if it doesn't I I don't know what's wrong um okay so let's see if this works are you ready do you have your popcorn popcorn ready for this maybe I'll fail maybe this won't work it might actually not work okay I'm unboxing this now hell yeah exactly the same path isn't that neat isn't that Isn't that cool we just we just we just did math and we got the exact same path that the rigid body flew um and so that this is just gonna this is just gonna work um we can change the last launch speed draw for a little bit longer uh maybe we can can even be spicy and rotate this a little bit uh or throw it uh over to a specific throw it throw it over there um okay and then we hit plate and then we unpause and it's flying exactly along that trajectory that's kind of cute right we just pre-defined that path um and so this would basically be like one way you can calculate trajectories um it's useful if you want to make like a game where you have to aim using some sort of trajectory like that um if you're making a worms game for instance which I believe you did before um you could literally visualize the trajectory of a projectile while firing or aiming if you want some cheats right um yeah and so so this is this is trajectories um okay um we're actually coming up on our next break um let's see I think there was a question right um you said never mind okay you try doing this with worms but never got it to work um okay I don't know what didn't work in that case but do you now know what you should do to make it work or was that more of it or was it a question okay um still don't really understand what this does um Collision mask um oh yeah that is not regarding my lecture I mean I kind of explained it if you want to um um okay any questions about trajectories I hope this is readable I don't know how much I can zoom out and still leave it readable mm-hmm [Music] me and my friend were playing around with Universe Sandbox a couple of weeks ago was showing the expected trajectory for the objects is that too complex uh what do you mean by too complex too complex for what [Music] um like is it similar to this or was there a hella ad on mats for the physics and stuff um I mean so in a simulated World um so it kind of depends like like there there are lots of like classical problems like that there I think they're called the antibody problem um um so end body problem is when you have um gravitational pull from several different um points of sources right um so if you want to read up on that that's the end body problem um so there are some special cases like the two body problem has like a nice solution for for two bodies that are gravitationally affecting each other but I think as soon as you get to the three body problem um it's no longer like deterministic I think um or maybe it is deterministic for the three body problem um but then I think four body problem becomes complicated um but yeah so this is a thing you can look up if you want to do that the other thing you can do um like in this case we have a function to directly evaluate a point on the trajectory which is kind of a luxurious thing to have because sometimes um because sometimes the functions that you have are so complicated that you can't just sample it at any time at any time right so then you would have to simulate it up until that time point which can be really expensive [Music] um we need a line render to show it in game right uh pretty much yeah or you can use shapes a vector graphics library for Unity um but yes you can use a line render oh you're trying to draw from the child object the position wouldn't match right does yours work when the script is on a child with an offset um the weight that I'm drawing this right now is that I'm drawing this in World space all of these points are World space and so they're not relative to you [Music] um yeah they're not relative to any object right now it's all World space um how would you do it in local space um well it's the same formula it's just that all of the inputs have to be in local space right if we wanted to come out of the barrel of a weapon um well that depends on what you mean by doing it in local space I suppose um you can do this in World space and still have it come out of the bare level weapon right that's what I'm doing right now um so moving this around the trajectory starts at that position right um yeah [Music] okay uh yeah we we should be on on break right now we're doing break until 11 10. um okay I need to make tea and actually go to the bathroom my tea is cold and almost out foreign [Music] there you go trajectory okay um team I'm making tea that's YouTube chat here's a background noise I'm making tea let me let me run my kettle it's important okay it fuels me you can watch a salad in the meantime um having the same issue as Adam uh what is the issue a sad line um we're launching it along the x-axis so I would rotate the object um so that the x-axis is pointing upwards a little bit I should be transformed.write okay I'm gonna get to you foreign foreign oh funny foreign because it almost looks off um shouldn't be no keep in mind that it's probably the perspective projection um so you might want to oh is he gonna stretch you think no he's just walking away okay um no this this should not be an approximation this is about as accurate as you can get um but I think it's uh if you if you make sure the rotation is uh flattened and then if you look at it from directly sign on then I believe it should be fully accurate is it rigid body have drag it could be that um because currently the our model has no drag at all um yeah so make sure drag is set to zero um okay if there is a difference um even if you have those parameters oh I just look look at the voice if there is a difference when you use those parameters then it's not the trajectory the math that we did that's inaccurate then it's probably Unity that's inaccurate because quite often in rigid bodies when you do like a real-time simulation you do have a lot of approximations um the formula we have does not have approximations it's about as accurate as you can get using floating Point Precision um oh what's the difference difference between drag and angular drag um drag is positional drag so um so if you if you're if you're moving an object and you want it to like slow down like positionally like you impulse and then slow down impulse and then slow down uh that's a drag and that's the um that's just a positional drag angular drag is for um rotation so if you want the rotation to slow down after you give it a torque impulse or you set the angular velocity and you want it to like slow down that's angular drag otherwise if you set the angular velocity it's going to just continue to spin forever unless you have angular drag um yeah um looks kind of good from the side um I guess if you want to test it you could pause when it's near the end see how accurate it is yeah it is a little bit off but uh that has to be Unity then uh I imagine there's generally a lot of like shortcuts you take when it comes to um uh there are a lot of shortcuts you take when it comes to physics it could also be if your line is low detailed but I wouldn't expect these to perfectly match um the further you go on I think they would go a little bit off um sorry I should have shown I should have shown this instead of solid flopping uh it is a little bit off for me as well if I pause it at the very end here um but I think that is um I think that is expected but I think the the approximation is Unity not your trajectory function your trajectory is more accurate than unity's simulation because the the simulation is doing it discrete lead like step by step um and so so that's why it's a little bit off um what's up with salad what happened to salad what did what did he do he just he just flopped uh if it's really important that our object follows the trajectory I guess we could change the position manually rather than use the rigid body um yes uh keep in mind that your trajectory doesn't take Collision into account but you could do that yeah you could make the rigid body like follow the trajectory until it hits something you could totally do that um so yeah definitely um um one thing that might actually be off I wonder if there is some sort of ghostly frame where maybe the rigid body simulates a tiny bit for one frame um so maybe we need to set the position as well or if you just had it offset from the start um so maybe this will be more accurate because I deviated a little bit too early I'm kind of surprised if Unity is that inaccurate um hmm I'm bad at pressing buttons yeah it does move one little bit um it's a little bit off hmm I'm not sure um okay but the remember the the thing we did before with the camera um where we had our movement here um using like timed out Delta time like this to do all of our acceleration and the like simulating our position this is less accurate this is an approximation um and the physics engine is unity and unity is working in a similar way because you the the physics engine can only work frame by frame it doesn't have like knowledge about the future because all of the conditions could change at any moment um so it wouldn't surprise me if it's a little bit off um because the the physics are working on a discrete method um but this trajectory is working on an explicit path that is like mathematically super precise um and so so yeah if anything is off it's unity's um if you really want the thing to follow the trajectory um I would either like simulate the rigid body or set the rigid body's position along the trajectory like explicitly um and then as soon as it hits something you stop following the trajectory um so you could do that um or you kind of do the other way around um you you simulate the trajectory using time dot Delta time or using time steps rather so then you would use the fixed time step to simulate the path um but that makes the trajectory get Point function then get points would actually have to simulate the physics up until that point for every time you call it um I think that would also work but then that's going to be more expensive to evaluate right but then you would literally simulate it right um can you show how to make a move along the line through code um sure um I just need to get my tea because we're kind of in a pseudo break right now and I'm gonna get my tea and then we're gonna leave break and then then we can do that seven seven okay um it was a longer break than I thought we would do but it was a pseudo break okay it's fine well salad is moving he's oh he's crutching scratching good job selling wow how is salad so good what a good boy we found a box it's in the box okay um with salad in the Box I believe we're ready to continue okay let's see read some questions um so the first one uh that we noticed was that the the physics of the unity's physics engine doesn't fully follow the trajectory like the the further you go forward in time um it's going to be a little bit uh off um and so that is that is likely uh because unity's physics engine and basically every physics engine ever um they are not deterministic and they hey what what sound is staring at me do you want to hop up hey come on come on up then okay I think he wants to meet my lip he was sitting next to me and he went okay um so every physics engine generally like simulates and discrete steps because they have to um it is um it is just the the fact of physics engine is that they can't predict everything because that would lead to like a permutation explosion of cases um and so you just have to approximate and so our trajectory is likely more accurate than unity's physics engine because unity's physics engine is working in like discrete time steps it's simulating step by step um so someone asked how do we make the physics object follow the trajectory um uh I wouldn't be more accurate if we cranked up physics calculations frame rate uh it might actually be more accurate I would guess that it's more accurate if we increase it but that's a good question um so where is our where's our physics frame rate is it in time fixed time step okay let's set it to a thousand frames per second let's try that instead um uh and that is way more accurate so yes um cranking up the physics frame it does make it more accurate which which is what we would expect right um doesn't that also affect frame rates um it if so this that's we changed the physics frame rate that's what we did and we made the physics frame rate to a thousand um physics frames per second um so that's that's what we changed um should probably set it back so that we're not let's let's do a hundred let's compromise instead of a thousand but if it needs to calculate more often won't the performance be worse yes it is expensive to do this um so like you can't just always crank your physics up to a thousand FPS um so it is going to be more expensive but in some games like my game flowstorm I could crank it up to a thousand because I'm using 2D physics and I just have one physics object and I just needed that one physics object to be really accurate and so there was no no real point for me to just not do that because I needed the accuracy um yeah okay um all right so the question was how do we make it follow the trajectory um like if we want to make it like follow it accurately instead of like launching it and leaving it to its own devices salad um but I guess there are many different ways we can do that we can either explicitly just set its position and velocity every like frame or maybe physics frame um we could um we could like correct it every now and then like every like every 0.1 seconds we we adjust it a little bit to make sure that it's on the correct course uh there are many different ways of doing it um but effectively we would we would silent do not um but effectively we would do something along the lines of um in a fixed update here we would basically set the position in the velocity um I guess velocity might not act no it does matter yeah we would set position and velocity directly based off of our function right here um I need a decoy toy for salad here you go um so we we would set the velocity directly um and the position directly every frame so in this case we would just call get point um time dot time uh or actually we would probably I'm not sure if we might want to use move position uh oh move towards position no I think it's fine to set rigid body opposition uh just keep in mind that you don't want to set transform dot position um when you're dealing with rigid bodies like this um because then the physics are going to get a little wonky and so now we need to also get the velocity at a specific point um so we can we can kind of just make that here so get velocity and now you've been equipped with the power of learning how to differentiate functions right so you know how to differentiate this uh position that's a constant gets deleted this is just a factor of T so we just get the velocity and this again remember this is our initial velocity the launch velocity um and then for this one it is cubed right so this is T or sorry squared so this is t squared so we take that 2 move it down um and then we'll reduce this by one um and of course the the division by 2 multiplied by two cancels out um and so we're left with this so this is the equation for the velocity um okay what remember these are the derivatives in other words they're functions where you get velocity at a specific time uh the velocity here that's called Vel is just the initial velocity and this is the initial position um and so this is the velocity at a specific time um so it's good to remember that um so now we basically do the same thing here where do you get velocity time.time um so this time variable um if you want to make this in a proper game this would be time since launch right um so you would keep track of when you launch your object um now it's just when the game starts so you you would replace this with a a relative time value rather than the absolute time value um okay um yeah and so I think this will work uh one thing when you're simulating a rigid body like this um you might want to make sure that it's not affected by gravity um and so kind of a kind of the standard way of doing this is to um set the rigid body to kinematic um and so that means we're kind of like um animating it ourselves instead of letting the physics engine do it but it still has collisions and that kind of stuff it other objects will still interact with this and then you would do something like um when it hits something we we turn kinematic off foreign yeah and um is kinematic means it won't it won't be affected by gravity um this cat I swear to God um kinematic means it won't stimulate uh we're turning off simulation basically um so we're just controlling it ourselves kinematic is a really really confusing name for this variable it should be called like um something else it's just a terrible name um hey salad okay salad is in full Gremlin mode right now um okay so how do we move it along the line without Unity physics and would that be better um so without Unity physics um you would basically just not use a rigid body at all and then you would set the transform dot position right so then you ignore everything physics related you set the transformed opposition and you can do that in update instead what um and then whether or not that would be better depends on your use case um because when you're just setting the position directly this is going to happen no matter what right but if you're using a physics object it all comes down to should it be interruptible by other physics objects like if should it be able to hit the ground should it be should other colliders like be able to fly into it while it's simulating like that kind of stuff and so so it all comes down to like how real time is your stuff like this is not going to take Collision to account at all and so if you want collisions and react like reactions with other things then you're gonna have to use a rigid body um it is of course possible to do stuff like you raycast along this path and then you can recast or detect surfaces and whatnot so if it's just a a single projectile that's very small it doesn't doesn't have like a big width or whatever then it's relatively straightforward to just do a recast Trace along the trajectory but yeah so it kind of depends on your use case um yeah but this would work just as well so this would um or wait it would be the we shouldn't move ourselves that would move the trajectory um yeah so this is going to do the same thing and there we go okay uh we have 30 minutes left uh until we're basically done with all of the the pre-planned lectures um so I guess where would you want to move from here what what are some last things you would like to to know about trajectories or derivatives do you have any do you have any questions how would you do X or Y or um how to factor in drag um that gets complicated uh they're uh yeah the equation becomes uglier the more factors and things you take into account um I think it might be on this this one um yeah where's the where's the one with drag air resistance here we go um okay uh yeah it gets a little bit more complicated but there's different types of drag some of them are you gonna hit like differential equations and it's going to be really gross um and it's it's just a mess and so so just it's it gets messy um so for these things it might just be easier to just simulate it frame by frame um as soon as you do these like predetermined paths uh then some of them can get complicated if you have a really complicated simulation um yeah uh you said something yesterday about simulating buoyancy is it possible to talk about that in the time we have left we could do that yeah how would you determine trajectory of intersecting with the ground using a line renderer um the line renderer has nothing to do with collisions so the line render itself is just for drawing um if you want to determine if it's hitting the ground you would raycast along every step of this trajectory um so you would kind of kind of get some points in the trajectory and then um do a short raycast ahead of time if it if it doesn't hit anything uh then you can move forward right um so if you have your trajectory um and then you have some ground somewhere uh then what you would do is basically just do tiny little raycasts uh every uh every time you move forward and if there's if you hit something then you you hit something if you didn't you just continue the trajectory do another raycast do another raycast do another a cast and so forth um yeah so if you if you just want to like check for something along that um okay buoyancy uh buoyancy is um can get either very complicated or easy depending on how you set things up um the uh the gist of it is basically you have some water surface right or some liquid I guess um and then you have some objects um yeah and so Sam buoyancy is basically a force that is applied to the object like upwards um and that force is directly proportional to the amount of water displaced here um and so you would basically have to work out like how much of the mesh is under underwater and then you would add a force based on that um yeah but it gets a little complicated because the the force position can vary right um so if you have a uh if you have a plank that's like this um sorry I should make a this is a better one like that if you have a plank like this uh you obviously don't want it to just move directly upwards right you don't want to like float and move to this position um and so you would have to add the force specifically at this location so that if you add a force here that would also like incur an angular Force to it as well um so it gets a little complicated with that but that's basically basically what you need to do um um but you can always like approximate it sometimes when you do buoyancy um you have like uh little points and then you just simulate these points and so if this is underwater you'd like check the distance to the top or something and then you add a force at that point and add a little Force at that point and then it's going to also incur the angular velocity um okay uh mesh generation we could talk about that as well um yeah do you want to talk about mesh generation um creating meshes in in code there I did add a few assignments on that so it's a good thing to learn um okay that's going to be the the last thing then um um all right so let's say that you want to generate a mesh maybe we don't want to want to generate the the most simple mesh of all the triangle or maybe let's do the quad um so a mesh is built out of vertices and triangles um there are other things in the mesh but for now we can just ignore those um so when you make a mesh you define vertices so vertices are these points here and so usually you have a list of vertex positions just like a polyline right we just have a bunch of points um so your um so your vertices is basically a Vector 3 array or a list either is fine um so so you specify each position of each vertex now each vertex has an index because of their position in the array um because you know how arrays works you have elements and you have element zero one two three four five and so forth and so each vertex is going to be associated with a number that's going to be its index and that just depends on the order you define them in um so this is going to be the the index for each vertex um and then you also need to define the triangles right we because meshes are generally built out of triangles and so so how do we Define triangles uh well triangles are defined by specifying which indices should be connected um so if you um let's just go triangles so the triangles array is an array of just integers um and all you really do is that you specify which three vertices should be connected and so maybe I want a um so if I want to connect uh this triangle right here if I want this to be a triangle in the mesh then what I would do is that I would specify these three indices so I can go three zero one and so if I do that 3 0 1 and we've now defined our first triangle um and then we want to define the next triangle we can do that here and then that one that triangle we want to form along vertex 3 vertex 1 and vertex two um so we just continue this um so in this case it would be three one and two and so triangles the triangles array is just a list of indices for which vertices should be connected um and yes the order is important um so so triangles have a front side and a back side um and so if you if you do three zero one uh they're normal or the the direction that the face is going to point is in this direction um how do I know that well Unity is Left-Handed right and again you can use your left hand and if you curl your fingers and you make this little thumbs up the curl of your fingers if the curl of your fingers is the the order you define the vertices in then your thumb is going to be the normal of that surface that's going to be the the face normal um so if we go back to to here um we Define them in this order right um like like this so we had three zero one so that means that normal is going to point in this direction by the left-handed rule if we did it in the opposite direction it would Point downwards instead um so that also follows the left hand rule so then we would have to do a thumbs down to Carl from three one zero so then then the phase would point the other direction right um so we want to Define it so that the normal is pointing in this direction um one three zero is still left-handed it's always left-handed but one three zero also makes this point in the same direction um so three zero one one three zero um or uh zero one three all of these would create the same triangle like so so they're basically equivalent there's some technicalities where one of them might be faster for the GPU but that's out of scope um and so yeah and so so it's only really like which order you're doing it in right kind of render both sides or is that only possible from the Shader uh that's that's up to the Shader yeah um the but basically what you're defining here is which uh direction should the front of this triangle Point uh but generally uh most shaders are use something called back face calling which means that the back side is not going to draw but you can turn off backside calling and then it's going to draw both sides um but yeah so so the order you to Define these and determine which direction it's going to be the front of that face right um and so this is how you define them and then obviously the the other one three one two is defined in three one two uh so that is in this direction and through the left hand rule we can then know that that's the phase normal of that face right um okay um so that's how you define define vertices and triangles um there are a shitload of other things and meshes but this is kind of all you need to know for the assignments um you can also Define the vertex normals which are going to be used in shading um so you might want to do those as well um but you don't have to you can take a few shortcuts um but the but each vertex also has a normal Direction in this case for a quad they're just going to point upwards um and so you could Define those as well as well those are just Vector three uh those are a vector three array just like the vertices um so we could could Define those if you want to um and so so these why did I erase the one thing I wanted to keep um izana said something because this is giving me index.range errors also what is the sub mesh sub mesh is um you can have multiple sets of triangles in your mesh um and so if you want to assign multiple materials to an object in unity you need multiple sets of triangles and those are called sub meshes let's see uh you're getting index at a range because your triangles list you're trying to access an element in the list that doesn't exist you're going to have to use triangles dot add instead of accessing an element in your triangles list um yeah um oh yeah both of your lists you should use add instead of accessing the index um okay uh do you want to see this in practice should we just should we make a mesh in unity yes okay um um all right let's make a mesh thingy uh mesh generator that's the name of our new script when generating meshes like this keeping track of your vertex in indices like these numbers right here is going to be absolutely crucial to everything you do I highly recommend drawing everything you want to do procedurally um draw the indices try to figure out how you set this up ideally for your algorithm and your use case always always draw um you're going to get confused real fast as soon as you start doing more complex things um and you just get this like triangle soup um that's just really confusing or index Auto Range errors but that's very common um okay um so we want to be able to display this mesh so I'm going to add a mesh filter and a mesh rendering um and we are going to assign a material um just as the default material um okay how do we want to generate this mesh um it could have every frame in on drug gizmos if we're feeling spicy we could do it in awake and we could actually we could do using a context menu why not learn some learn some more things um you can add a context menu to any function in unity so this could be like generate mesh and this will add a menu so you can right click on your components and you'll be able to call this function in unity um all right um so let's try it out make sure that it works when we got our gutter console and then we can right click our script and then we now have a button that says generate mesh and if you click that we get our get our log message um and so just a nice way to to just inject functionality into the editor um all right and so what we want to do is we want to generate let's generate a quad mesh I guess because it's easy um I don't know if we should do like a super complex example um so we're gonna need um a list of vertices right and we're going to need a list of triangles and those are just going to be indices and we're going to have we're gonna need a mesh it's the mesh itself right so we're going to Cache that um boys so it matches a null we're going to create a new mesh um new mesh screen up one thing to keep in mind this is a Unity object and unity objects um as in they are objects that are inheriting from Unity engine dot objects other things like that is like materials so like new material so like any assets you have in unity are also Unity objects and the reason that's important is because the garbage collector is not going to collect this garbage because you created an asset um and so it's very very easy to accidentally leak meshes as in you're going to create meshes over and over and over and over again um accidentally um and so so just be careful not to just create a mesh every frame um because that's gonna that's gonna just flood your unity and you're gonna run out of ram um kittens are playing Pretty violently um okay so we need to make sure that it's it's actually null before we create a new mesh just just to make sure that we're not just over creating meshes um okay and if it is if we do create a new mesh we want to assign it to the mesh filter so we're just going to do get components mesh filter dot shared mesh equals mesh um in general when using mesh filters and mesh renderers use the ones that are called shared mesh and share the material those refer to the actual asset that it's using if you do dot mesh this actually creates a copy of the mesh which is very easy to accidentally do when you don't want to um so just just keep in mind which one you're using um so shared mesh basically means mesh asset and then the one that's just mesh means mesh copy um okay so we're assigning a mesh to the mesh filter after we create it but we're not actually doing anything with the mesh itself we need to do something with that data um okay so our vertices uh what coordinates do we want to use here I guess we can just use the same coordinates as we just drew um so um where's my pen so we have our our usual Unity axes we have y here zooming is hard so where the y-axis um and then we have the x-axis and the z-axis and so we can we can kind of decide like what plane we want this um this quad to be in if it should be on the X Y plane or the XZ plane and so forth that's kind of up to us right um so if we want to match it in this case the way we drew these coordinates um then we would have to use the X Z plane right um okay so we can just explicitly Define them right here um is that new Vector three so we're starting with this one so let's put that at so that's going to be negative X because it's on the negative side of the x-axis and negative on the z-axis that's going to be let's do negative one and the zero on the y axis and negative 1 there um okay I forget the Syntax for for this I think I think okay there we go um all right and then the next vertex is going to be this one so that one is that positive uh Z that's the only difference between those two flipping that to positive next vertex is going to be here we're flipping it on the x-axis so we flip the X to the other side um boys chill and the last one where um flipping along the z-axis so we're flipping the Z value and there we go whoops um now we have some vertices um one thing you might want to do if you're as pedantic as I am about code alignment and you can actually type plus um so unary plus is an operator that basically does nothing but it can be nice to make your code align because then you can see the the signs a line like this all the stars are aligned isn't that isn't that neat um um okay and so we now have our vertices but we don't have triangles so we need to Define our triangles okay and that one we've basically already done the work for we just type them here right we have three zero one that's our first triangle pointing in that direction and then we have three one two which is our second triangle also pointing in that direction uh so three zero one three one two three zero one uh three one two um and that's that's basically it right like those are the the triangles we want to use and then we need to apply this to the mesh so in case we have some old data we might want to clear it first and then we want to do mesh dot set vertices and then we pass the vertices into there and then we do mesh dot set triangles and then we pass the triangles into there it also wants a sub mesh you can just set it to zero um sub meshes is basically you can have multiple sets of triangles if you have a mesh in unity where you assign multiple materials that means that it has multiple sub meshes um yeah and so so set triangles we just want to default to zero there um okay and then um the mesh dot uh we might want to call Master recalculate normals recalculate normals kind of Auto calculates um which direction thinks the vertex normal should Point um but in our case we could actually just like Define the normals ourselves which is going to be faster too so let's do the normals and the direction of the normals in this case is very simple it is just the the y-axis right so this is going to be vector3.up and that's going to be the the direction of the normal um so so all of these are just going to be um Vector 3 dot up um okay so instead of Auto calculating the normals we're going to assign them set normals and normals okay um and I think that's it I think this should do it I think this will generate our quad uh I guess we can we can go to Unity and double check and so we have our mesh generator and then we right click and do generate mesh and now we have a mesh our own home brewed mesh is isn't that cute we did it um we have a we we made a mesh you don't need 3D artists anymore right you can just you can just do this just just write a character using Vector threes um okay so that's the basic of mesh Generation Um any questions about that we have meshes at home and so then obviously in this case we could just explicitly write the values but quite often uh these are generated by something right like we could literally like take our trajectory function and make a for Loop that like generates vertices at specific points in the trajectory so we could do stuff like that as well um so so there's there's a lot of things you can do with this especially as soon as you start creating the for loops and you like um yeah just doing all of these things like that can we do it iteratively uh what do you mean by iteratively in this case with like a for Loop do what with a for Loop um I mean yes but in this case the the the triangle or the setup of the mesh is pretty simple right um and so we would just have to do the same thing but with the for Loop um but like there's nothing like special about these uh they're just lists and how you uh populate that data is up to you as you can absolutely do that with um uh with your uh with for loops uh so when we set triangles to 301 is that setting on them to vertices index three zero and one yes um how do you fix rotation uh what do you mean by fix I didn't quite follow why was that the normals doesn't that follow from from the triangles um so there's a difference between what's called vertex normals and there's a difference between um face normals uh so phase normals uh don't really are only implicitly defined by the winding order of each triangle so the face normals is just the direction that the face is pointing um so the direction of this face um and this face is fully determined by the order in which we Define these right so that's face normals um but then we also have vertex normals so those are the things you see here so these are the the direction that the vertex is quote unquote pointing um and this is mostly used in shading um so if you if we look at a mesh from side on let's say we have a um a very low poly cylinder and you imagine we have some vertices here um then I'm going to duplicate that for future purposes um and so what the normals basically tell you is which direction should we shade this as and so if this is pointing in that direction there and then here we're making the normal point in this direction and here it's pointing in this direction and here it's pointing in this direction uh when you're shading this when you're doing shaders this is I guess we have the Shader cars later but this is something we're going to talk about during the Shader course um but the the vertex normals are interpolated across the triangle uh so when you're shading this as in shining a light on it and we see the light fall off and everything um this surface is going to look smooth it's going to look like this surface um has the normal defined there right so this will actually approximate a soft shape like this um if I'm able to draw a soft shape so this will look like a curved surface when you look at it when you look at how lighting affects it and so this is how unity's like built-in Primitives work so if you uh if we create a cylinder I'll delete the collider like you can see that it's very low poly right you can see that this is like not a very high resolution but the shading looks smooth well kind of smooth right and the way that that's that she achieved is specifically because um the vertex here has one normal and it's pointing out in this direction and then it's blending the normals in between so that the normal Direction uh looks smooth right so kind of smoothly interpolates like this um and you can start if you remember slurp that's basically what it's doing but it's it's cheaper to do just lurp and normalize um but but yeah so that's that's how smooth shading works that's why meshes look smooth because you have vertex normals like this uh if you wanted to not have a soft shading if you want to not have a smooth shading you actually have to duplicate this vertex because now you need to have two normals at this point because you need normals like this right and so this is usually called hard edges sometimes it's called split normals but that's a bit more of a programmer or Tech art term um and so so now this is going to be shaded as if it's completely flat and this is going to be shaded like this is completely flat and so you get a hard boundary here so that's why there will be a hard Edge at this point um and so so this is kind of the the how you achieve smooth versus um hard edges it's funny how flat shaded models have lesser vertices yes it's kind of an interesting artifact of how this architecture is one set up um and so if you want hard edges or if you want any data on this vertex to be different um you have to duplicate that vertex um yeah and so so that's that's the difference between soft edges versus hard edges um all right um um okay I hope that made sense um any other questions did I miss a question uh oh yeah so we were just wondering about the normals uh yeah so so that's the difference between the the face normal and the vertex normal so so vertex normals are used for shading uh generally uh and then the the face normals are just implicit from the uh from the triangle uh order right uh uh okay I have a few questions regarding the assignments uh is it about how the what what the assignment is because if so that might be useful for others to hear too um okay yeah so go go for it ask questions um we're kind of going over overtime but that's okay I think uh we have no lectures after lunch this time um but I will stick around I will exist on Discord um and then um and then I will I will help you all out if you need help and I will be available um uh oh you're asking about the triangulation right um and so um basically one of the assignments uh the one called convex polygon triangulation um bring up the things and this one so the assignment is basically to triangulate a set of 2D points and what triangulate means is effectively creates a mesh from these points um and so so basically what we did here is that we triangulated a quad mesh right uh we we made a mesh and then we created triangles that filled it in right so triangulate is the process of uh dividing up a polygon area into triangles and so that's what that means um so for convex polygon triangulation effectively create a mesh where you supply a set of vertices um and so so you just maybe you make a public list or array of vertices and then I want you to create a mesh from these vertices so it just like triangulates this whole thing so divides it up into into triangles uh that's what that is that is the convex triangulation assignments did that make sense so basically what we just did here but instead of just four points you should be able to supply any number of points and then you should be able to triangulate it and your triangulation algorithm does not have to handle convex or concave polygons it only needs to be able to do this with convex shapes um yes the the more advanced one quite significantly more advanced one is the concave polygon triangulation um yeah I'm going to add a hint to this one as well because it might be tricky to figure out on your own um yeah but it's a fun challenge all right any other questions about the assignments bye way or questions about derivatives or trajectories we've kind of done derivatives trajectories mesh generation um anything else before we before we head off for lunch uh yeah for those of you don't know I I did add a bunch of assignments to the document that I've been linking a few times in um in Discord it's also in the description of the YouTube video if you want want to link to this um some of these are much more difficult than others so I mark them by difficulty um and so pick the ones that you want to do like the the concave polygon triangulation this might take all of today and all of tomorrow to do depending on like your skill level what you're comfortable with and so forth um and if you just want to do something that's a little bit easier to repeat a few things we've already talked about then it's better to pick the the first few assignments here like making a health bar making a spring or a donut shaped spring uh and so forth um so just pick whatever you think is on your skill level what you think you will learn from um and yeah and so that's I hope hope this will be useful I can also add a few assignments on trajectories now because we've now um we've now covered that um so if you want more trajectory stuff I could have that um um I have a question regarding this I really want to learn but if this is what we turn in I might want to go for something I'm more comfortable with um I don't know where you're gonna have to turn in that's up to Crystal he's gonna be the one who determines that um I think I will send this to Crystal and he if he wants to use my assignments um he can do that or he can come up with his own assignments um so it all just depends on crystal um I'm sure you can convince him to specifically use some of these um and so yeah um so I think for now none of these are gonna be uh turned in uh so for now for for the rest of today and for tomorrow um just work on whatever you want even if it's too hard or too easy pick whatever you want um whatever you think is best for your learning process or the most interesting uh then just just pick whichever one you want to do um I don't want to pressure you to like do all of them or specific ones um I think I think you're going to get assignments later uh after this week from Crystal um so for now ignore assignments just pursue your dreams and do the assignments that you want to do that appeal to you as a human being um uh okay all right are there any final questions about mesh generation uh about about our trajectories or well what else pursue our dreams I'm gonna become a bezier curve you know then I recommend I recommend doing the bezier mesh assignments so so there you go so so so that's that's that's the thing that is the flowstorm assignment um is it like iterating on the line and then putting caps at the end and yeah basically in this case I don't even need caps and so the the tricky thing about generating meshes like this um it's not usually the math itself to get this path because you already know how to do bezier curves right you know how to get a point on a bezier curve um and so forth and so the um the challenge usually is just keeping track of all the goddamn indices for each vertex and there's going to be a lot of modulo and a lot of like messing about with those the biggest challenge is just keeping track of what vertex has what number and then creating the triangles correctly that is often the hardest part especially if you want to um especially if you want it to be optimized there are many like unoptimized ways to do this um okay feels weird to get assignments when it's the end of the course uh well you know that's that's how how it do um it's not really the end today remember we have a lecture on Friday as well um a Friday is going to be our uh grab bag of random topics that you want to talk about um I think we've um you started a thread on on this channel right where people have suggested a few things um I think what we should do is that after people have suggested things in that thread um I'm gonna make a Google doc like a Google survey and then you can vote on things and then we'll just go from there um will you continue to scribble uh yes I'm Gonna Keep scribbling because we're going to talk about more things and so so yes um yeah um uh all right so if there are topics you want me to talk about again just just bring them up um and then then I'll I'll filter and pick based on what you want what you're interested in what I'm interested in what I'm knowledgeable about and so forth um okay um all right I guess no more questions I guess we're all hungry because I've gone a little bit over overtime um yeah like I mentioned the rest of the day is just working on assignments and I will be available if you need me I'm going to hang around the Discord um and so so if you have any questions or you need me for anything just let me know because I am booked today I am not here tomorrow tomorrow you're going to work on your own I might pop into the discard every now and then but that would be unofficially that would be secret um and then on Friday we have our our very very special day where we're going to go through things that are just whatever you want to talk about um I think that's going to be fun especially if you pick fun topics pick good topics I don't know what that is but pick them um all right um yep okay thanks all the students go for lunch uh anything anything on on YouTube um any questions from YouTube looks like they're not uh is multiplication faster than division uh generally yeah um okay that was all of the sort of planned lectures um good luck with the assignments uh I hope they're gonna be useful and and and eye-opening and and whatnot um if um yeah if you have any questions if I if you need me to clarify anything about the assignments just let me know um and I will do so um yeah just don't don't hesitate to ping me just just do ping me on discard uh I'm I'm here to help you and so don't don't don't be scared in fact it's really awkward for me if nobody pings me because then I feel useless so please help me feel useful by pinging me all the time um okay uh thanks for joining everyone uh thanks YouTube for joining uh and I will be back on stream on Friday that's where we're gonna do the last lecture otherwise I'm going to be done with the stream for today um okay thanks everyone bye see you see ya after lunch if you're my students at future games and on Friday if you're on the internet um all right bye everyone
Info
Channel: Freya Holmér
Views: 63,833
Rating: undefined out of 5
Keywords: Acegikmo, Freya Holmér, Freya, Holmér, Twitch, Unity, Unity3d, math, vectors, dot product, scalars, numbers, mathematics
Id: XkAuksIABHI
Channel Id: undefined
Length: 192min 20sec (11540 seconds)
Published: Wed Nov 02 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.