Interpolation & Velocity • Math for Game Devs [Part 4]

Поділитися
Вставка
  • Опубліковано 8 тра 2024
  • last but not least, we'll be talking about the ever present lerp and its friends, along with a quick overview of rotations & point velocity!
    If you enjoyed this series, please consider supporting me on Patreon!
    🧡 / acegikmo
    00:00:00 - Asgmt. 7 solution (Regular Polygons)
    00:17:39 - Asgmt. 8a solution (Adaptive FoV)
    00:45:52 - Asgmt. 8b solution (Adaptive FoV)
    01:04:26 - Asgmt. 8c solution (Adaptive FoV)
    01:33:18 - Interpolation
    01:49:31 - Lerp example
    02:03:19 - Inverse lerp
    02:22:57 - Remap
    02:33:48 - Blending images using lerp
    02:34:51 - Bezier curves
    02:47:39 - Velocity
    03:12:19 - Rotations
    Assignments:
    Asgmt. 9a (Coil)
    Asgmt. 10a (BC Inventory)
    docs.google.com/document/d/1N...
    03:39:47 - Asgmt. 9a solution (Coil)
    03:52:41 - Asgmt. 9b solution (Coil)
    03:55:53 - Asgmt. 9c solution (Coil)
    04:15:00 - Asgmt. 10a solution (BC Inventory)
    04:30:21 - Asgmt. 10b solution (BC Inventory)
    Originally streamed as a course for students at futuregames.se/, who were super kind to let me both stream this live as well as upload it here! so massive thanks to the people at FutureGames!!
    💖 Patreon ❱ / acegikmo
    🐦 Twitter ❱ / freyaholmer
    📺 Twitch ❱ / acegikmo
    💬 Discord ❱ / discord
    🌸 Instagram ❱ / freya_holmer
    ✫ Video Production by Higher Vision:
    ➥ / highervision1
    ➤ Edited by Stelly: / stelly47050876
  • Наука та технологія

КОМЕНТАРІ • 105

  • @danielfilgueira2893
    @danielfilgueira2893 2 роки тому +32

    "So I guess that's it, that all of the math course".
    I found it funny the anticlamatic ending for such a journey I've been through, watching and studying theese classes hahahah.
    Seriously, though, thank you Freya for the amazing demonstrations, it is already helping me improve a lot as a game developer :)
    Heading to the shaders one rn

  • @alexhillel8612
    @alexhillel8612 3 роки тому +11

    I love this series. Clear and succinct, some parts dense but always approachable, and underpinned with practical application. Thank you Freya!

  • @dango9941
    @dango9941 2 роки тому +10

    I just finished this amazing course for some training at work. I'm very bad at Math so it was a challenge, I couldn't even complete some exercises without looking at your solution, but I definitely learned a few incredibly useful things. Thank you so so much!!

  • @oddorangeowl
    @oddorangeowl 3 роки тому +2

    This lecture was amazing! I'm excited to watch your new shader series!

  • @hughsprague
    @hughsprague 2 роки тому +1

    Two enthusiastic thumbs up! I am an "old newbie" learning Unity and Blender as a hobby. I wish I had found this day one. I struggled with the basic concepts and finally got things to work through sweat and tears. Thank you for the time and effort it took to create this series. Now, I need to go back and look at the hacks I coded to get things to work around angles, movement, etc. Awesome tutorial. Onto shaders!!!!🤣

  • @dennismckenzie8329
    @dennismckenzie8329 Рік тому

    I love the way you explained array wrapping using the modulo operator and index out of bounds.

  • @senser1o76
    @senser1o76 2 роки тому

    The best explanation I've ever seen. Really fascinating.

  • @pogostar1878
    @pogostar1878 Рік тому +4

    Assignment 7
    5:14 - Circle angles fun-fact
    11:06 - Array wrapping (modulo)
    16:09 - Regular polygon exception
    Assignment 8a solution
    Assignment 8b solution
    Assignment 8c solution
    1:11:22 - Projecting onto space
    1:19:59 - Cam point to avg position of points
    1:23:42 - Shader talk: URP vs HDRP in Unity
    1:27:32 - Fractal shader
    Interpolation
    1:43:43 - Extrapolation
    1:45:14 - Slerp
    Lerp example
    1:54:13 - Using lerp for smoothing
    1:59:08 - Quick lerp questions
    2:00:22 - The math behind lerp
    2:02:38 - 😺
    Inverse lerp
    2:11:25 - Math formula, edge cases
    2:14:25 - inverse lerp example
    2:21:45 - Photoshop levels example
    Remap
    2:26:58 - Remap examples
    Bezier Curves
    2:42:58 - Use case example
    Velocity
    2:55:30 - Acceleration
    2:57:05 - Unity example
    2:58:35 - Velocity formulas
    3:01:52 - Unity example, cont'd
    3:07:29 - Why multiply by Time.deltaTime?
    Rotations
    3:18:37 - Angle-axis rotation
    3:20:55 - Angular velocity
    3:23:09 - Shortcut: Perpendicular vector
    3:25:55 - Shortcut: Rotating in 2D by arbitrary amount (Matrix 2x2)
    3:34:13 - Using Quaternions

  • @AndersonMarquesss
    @AndersonMarquesss 2 роки тому

    I struggled with some tasks, and others were really fun to complete, but in the end I learned a lot.
    Thank you for sharing with us.

  • @CosmicComputer
    @CosmicComputer 2 роки тому

    Sincerely Freya, thank you for sharing all this knowledge.

  • @Spaaace
    @Spaaace 2 роки тому +3

    Freya, you're awesome and an inspiration. Thanks for the math.

  • @amyhaber5712
    @amyhaber5712 2 роки тому +2

    Much appreciate if you can bring us more about math & shaders, excellent work!

  • @thetiphon
    @thetiphon 20 днів тому

    I'm bad at math, trigonometry and english but this series helped me a lot. I've implemented some assignments in godot and now feeling much more comfortable when see code that has these weird functions and vectors. Thank you

  • @GankablePlayer
    @GankablePlayer Рік тому

    Thank you so much for the course!

  • @PumpiPie
    @PumpiPie 3 роки тому +1

    Nice video :D
    Learned mutch. Keep up the good work :D

  • @CH3R.N0BY1
    @CH3R.N0BY1 Рік тому +1

    worth going through the whole series for the ears

  • @carlaludgate6597
    @carlaludgate6597 2 роки тому

    You're a fantastic teacher!

  • @yumiyonashi8518
    @yumiyonashi8518 2 роки тому

    Thank You Freya ....you are my first real math teacher i guess..god bless you.

  • @traz4038
    @traz4038 2 роки тому +3

    1.03.00 we could find the point of most outer circle's tangent and use the dot product code earlier to find most outer one. Then calculate the angle between. I believe its more efficient and works fine but its good to see there are many ways to solve it with using different methods

  • @Matt23488
    @Matt23488 2 роки тому

    This series has been absolutely fantastic! Also, Thor

  • @desarrollojava
    @desarrollojava Рік тому

    Excellent video!

  • @Ferenc-Racz
    @Ferenc-Racz 3 роки тому +1

    wow.. finally an enjoyable math teacher.. (no she is programmer, but with a good explanation skill.) :) I subscribed! Thank you for your work!

  • @ahbarahad3203
    @ahbarahad3203 3 роки тому +4

    Please upload more lectures these are one of a kind

  • @Murilo_Oak
    @Murilo_Oak 2 роки тому

    I owe you a lot! Thanks!

  • @bhaveshtiwari5783
    @bhaveshtiwari5783 3 роки тому

    Loved the video plz do more your amezing ❤️

  • @mohokhachai
    @mohokhachai 3 місяці тому

    We need people like yu

  • @miloszgierczak4806
    @miloszgierczak4806 Рік тому

    Everytime im comming there, I feel like im watching a missing season of big bang theory and i love it!

  • @CaptainSlowbeard
    @CaptainSlowbeard 3 роки тому +1

    I know this is a bit of an inane comment, but you have a really nice voice.
    This was my main point, but probably related, I honestly love maths but got convinced by teachers that I was terrible at it when I was a kid in school. It doesn't seem very intimidating when you're explaining all kinds of interesting stuff. Hope you keep making more vids 👍

  • @AJ213Probably
    @AJ213Probably 2 роки тому

    I like content like this even if I don't end up fully understanding it. At least I am able to say "Hey, I remember there is a solution to my problem out there... Oh it's inverse lerp!"

  • @botteu
    @botteu 3 роки тому +1

    @Freya Holmér Great video, great series! Trying to understand this stuff by perusing maths sites usually breaks my brain but you make it so clear. Thank you 🙏
    I have a question about trajectories (kind of) that I haven’t been able to figure out but I’m sure is in there somewhere.
    How do I find the initial velocity vector if I have the following pieces information about a projectile: Starting position (A), landing position (B), gravity vector (g) and speed (s, which is a scalar constant)? All vectors are 3D where Z is up if that makes any difference.

  • @z08840
    @z08840 2 роки тому

    4:51:15 you don't need "the law of cosines" - radii produce an isosceles triangle, in which angle bisector is an opposite side bisector perpendicular to this opposite side - so you have 2 triangles with hypotenuse = r, and opposite side = (a+b)/2, so alpha = 2 * asin((a+b)/(2*r))

  • @yousefsayed6380
    @yousefsayed6380 Рік тому

    This course is awesome, definitely the best math course you can watch on the internet! :)
    Also can you put a link to the image file as it would help for revision
    Thanks 🙏.

  • @aric7726
    @aric7726 Рік тому

    When you started talking about whether iLerp was clamped or not I thought you were saying "clapped" and I was nodding along like 'yeah iLerp in unity is pretty clapped'

  • @Ten_
    @Ten_ 2 роки тому +1

    This whole course was great! Thank you for providing it for the public too!
    Two quick questions:
    1. I don't suppose there's a printout of the photoshop page you were working on? Or is that futuregames stuff?
    2. You mentioned you had more Bexier curve resources - are those still around?
    Thanks again!

    • @King-mj2bn
      @King-mj2bn 2 роки тому

      Just take notes. You'll remember far far better if you do.

  • @LocdnessMomster
    @LocdnessMomster 5 місяців тому

    Your videos make me want to go back for a PhD in math, i love math

  • @Alex-fp2sx
    @Alex-fp2sx 2 роки тому +1

    hi. love it . kind really want the ps picture , can i ? or where to get it . thanks

  • @mohammadebrahim4038
    @mohammadebrahim4038 Рік тому

    hi Freya, thanks for the series. where can i find the exported images of your explanation in photoshop? did you upload them somewhere?

  • @stephenyork7318
    @stephenyork7318 2 роки тому

    For the dirt homework question, wouldn’t it be easier to just go to the first point and use 180-360/n ? You’d have to calculate a little extra from the starting position to the first point but you’d essentially just need a single loop.

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    3:01:51 its like memory triangle. make pyramid shape pos on top and bottom v*t and line between.
    what ever you need calculate put thumb on it and you got fotmula to get it. works awesome on sin cos tan no need think do i need multiply or divide and what order. there is allways 4 psibilities and 1/4 time you nail it LOL

  • @araldjean-charles3924
    @araldjean-charles3924 Рік тому

    I am a big admirer of your work. I hope I can introduce my son to it. He has become a teenager (everything is negotiation). However, I disagree with your comments about modulo. One has to be internally consistent once you are using them. They form a cyclic group under addition. Z%4 has 4 elements: namely {0,1,2,3}. It is literally taking all the integers and cyclically mapping them to {0,1,2,3}. So what is -1 in that world? The so-called additive inverse is the number you add to 1 to get 0. So -1 is actually 3. Proof: 1+3 = 4; 4%4 = 0 QED. Another example what is -7 (i.e. the additive inverse of 7), 7%4 = 3, 3+1=4; thus, 1 is the additive inverse of 7 (also note 7+1 = 8; 8%4=0).
    To generalize, take any negative integer -n; -n is the additive inverse of n. Find n%4; what number y from set {0,1,2,3} you must add to n%4 to get n%4 to be a multiple of 4. That number y is -n in Z%4
    Thank you for your excellent work!

  • @nobels3246
    @nobels3246 Рік тому

    @Freya Holmér Question to calculating the auter most point at 32:45. Since you have normalized the directions to the points i fail to see how checking the max y value won't work to figure out the auter most point.
    Great video by the way

  • @epicbattles3887
    @epicbattles3887 2 роки тому

    for the coil thing. if you don`t have Freya`s math lib. I got it sorted with this :
    ...
    float circleRad = Mathf.PI * 2 * tWinding;
    Vector3 pt = new Vector3(0, Mathf.Cos(circleRad + i), Mathf.Sin(circleRad + i))* coilRadius;
    pt.x = i * height;
    points[i] = pt;
    Gizmos.DrawSphere(points[i], pointRad);

  • @kiat4797
    @kiat4797 2 роки тому

    We want more .

  • @zekunyang4686
    @zekunyang4686 2 роки тому

    Really good.Without subtitles, my English is not good, no, no, no

  • @bzikarius
    @bzikarius Рік тому

    2:09:40
    Do the negative volume!
    It will suck out voices from your head!

  • @samferrer
    @samferrer Рік тому

    39.10 ... is practical to have a 180 deg field view theory? The camera can be rotated too.
    But if you have to, then lobachevsky is a good approach...

  • @usoppgod8107
    @usoppgod8107 3 роки тому +6

    Great lecture. Is this the last one? That would be sad. I would be thankful to know if there is more math i would need to learn to get better at shaders.

    • @acegikmo
      @acegikmo  3 роки тому +16

      last one for now yeah! I have considered making more parts if people would want me to, but, nothing planned yet

    • @eongft4027
      @eongft4027 3 роки тому +2

      @@acegikmo we really want

    • @Flobbled
      @Flobbled 3 роки тому +2

      @@acegikmo please do more

    • @supertenchoo4271
      @supertenchoo4271 2 роки тому

      @@acegikmo make more.. you are an awesome teacher

  • @z08840
    @z08840 2 роки тому

    try to solve first problem for next terms - position camera (including angle and direction) such as all points fit in its FOV and distance to (barycenter of) points is minimal - and do it in 3d space - and suddenly it becomes quite non trivial :)

  • @Pandorarl
    @Pandorarl 6 місяців тому

    37:02 Is normalizing the vectors more expensive than dividing the dot by the lenght of the not normalized vector. Dot(a,b)/lenghtA = cos(a)

  • @AlexxxMurkin
    @AlexxxMurkin 2 роки тому +1

    1:51:15 you're turning into mathematician here, haha.

  • @Chimponaut
    @Chimponaut Рік тому

    Great series, thanks for it. As a little animal side note: never lift adult cats in their neck this may result in breaking their neck. Cats lifting their kittens in the neck is fine because of the low weight of a kitten, the adult cat is not built to be able to support being lifted in the neck like that.

  • @devil2005iscool
    @devil2005iscool Рік тому

    if you import the crypto library you can use alot of these already public predefined functions

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    23:00 idont want draw gizmos lines anymore. there is it forrach loop back. you allready knew you need it why erase xD

  • @oddorangeowl
    @oddorangeowl 3 роки тому +1

    At 3:32:32 , shouldn't the negative sign and positive sign be swapped? Since the y basis vector is the one with the negative.

    • @oddorangeowl
      @oddorangeowl 3 роки тому

      Wait, got my matrix multiplication mixed up. All good!

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    3:08:16 it all ready was you just made variable name

  • @richardguilliams7278
    @richardguilliams7278 2 роки тому

    Hi freya. im currently having a strange issue with my code and havent found an answer anywhere online. was wondering if i could post it here and get your help if possible? it involves locking my players velocity to the normal of the wall they are climbing. My code seems like it should work but something is off becuase my player slowly moves away from the wall till the raycast loses detection

  • @ridespirals
    @ridespirals 2 роки тому

    where did you get that little 3d xyz thing you hold? I want one.

  • @2002budokan
    @2002budokan 2 роки тому

    Great content, great explainations, having a content list for huge videos is great; but why do you erase and rewrite all over the time?

  • @ahmedfarooq7253
    @ahmedfarooq7253 Рік тому

    ♥️

  • @zalxder
    @zalxder 2 роки тому

    3:05:24 the game opens and you try to walk but immediately die in lava at the end of the level and the credits roll

  • @hariharanvnseven
    @hariharanvnseven 2 роки тому

    Time 4:11:02
    Whats corePt + localPt.x * xLocal + localPt.y * yLocal
    I thought xLocal as oriented x Direction and yLocal as oriented Y Direction
    why do we need to multiply LocalPt with xLocal and yLocal
    what it will do

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    39:21 you can get angle without getting dot you all ready had x and y distance for point before dot lol so you calculate again

  • @clown3949
    @clown3949 Рік тому

    It`s really usefuul, if you already know math

  • @samferrer
    @samferrer Рік тому

    2.01:30 I think lerp(A,B,t) = A + (B-A)t is simpler

  • @imteajsaimun4134
    @imteajsaimun4134 3 роки тому

    Make a video on how to shoot bullet in a round planet pls pls😊😊

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    2:54:22 remove mph bcoz we not use feet/s in math lol or inch/second. can allways convert kph to mph lol

  • @skaruts
    @skaruts 2 роки тому

    I wish you could turn on auto-generated subtitles. I don't have sound atm. :S

  • @rheemboi
    @rheemboi 3 роки тому +1

    Where can I get your math library

    • @acegikmo
      @acegikmo  3 роки тому +3

      github.com/FreyaHolmer/Mathfs

    • @rheemboi
      @rheemboi 3 роки тому +1

      @@acegikmo thanks

  • @muthu1593
    @muthu1593 3 роки тому +2

    Could you please send me that Photoshop image

  • @diogoduarte4097
    @diogoduarte4097 9 місяців тому +1

    Lerp? More like... LARPing as a slerp, amirite?

  • @egmeatom
    @egmeatom 3 роки тому +2

    Why there is no subtitles? Can UA-cam create it's own?

    • @acegikmo
      @acegikmo  3 роки тому +4

      the video is too long for youtube's auto-generation unfortunately :c

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    41:35 i have ever in my life heard FOV as radians LOL use degrees sin cos tand and pi LOL and what is it matter it is same thing just need convert LOL

  • @aotahuu744
    @aotahuu744 2 роки тому

    Can anyone share a summary copy of this course in PDF or PSD?

  • @user-oe1zm6ub6i
    @user-oe1zm6ub6i 3 роки тому +3

    I’m a developer from Taiwan. Because I can’t understand English, I rely on subtitles.Can you help me with subtitles? English is fine.
    This is a google translation. Please forgive me if I don’t understand. Thank you

  • @markmanning2921
    @markmanning2921 2 роки тому

    if I watch all your videos over a 3 day weekend is that binge watching :)
    p.s. dont use % when your array size is evenly divisible by 2, use &
    index++;
    index &= (array size -1);
    no division
    p.s. i also saw 7 regular polys not just 2 overlapping triangles :)
    but you knew that :)

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    9:41 you have nice 2x2M square bcoz use radians without multiply with radius lol

  • @boon8950
    @boon8950 2 роки тому

    panoramic

  • @cmyk8964
    @cmyk8964 2 роки тому

    I hate Godot’s default % behavior, and literally can’t think of a single use case where posmod() doesn’t work but % does.

  • @MrRoBot-wn4kp
    @MrRoBot-wn4kp 2 роки тому

    Please open subtitle for this video

  • @mykelas531
    @mykelas531 3 роки тому

    "it is ma'am!"

  • @VillageIDT
    @VillageIDT Рік тому

    The modulus is typically computed as the remainder of an integer division, so a negative dividend won't give an intuitive result. You can get around this by simply casting the dividend as an unsigned integer, so -1 becomes 4294967295 for a 32 bit integer. This should give you the desired result.

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    3:18:12 long story short. you will use dot product to rotate LOL where i am where i need go dot it rotate delta time

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    6:16 YES that one is 120 write it LOL pentagon was 108? never thing that way i think 72 LOL 360/5 degrees are easy lol lets use radians 1 tau 6-24.... noh its pi2 use it you love it use pi lol

  • @deefdragon
    @deefdragon 2 роки тому

    cat ears at 2:02:37 for anyone who wants to know why.

  • @hero_big9234
    @hero_big9234 3 роки тому

    Hi Freya. .

  • @user-lo5ws2pm5h
    @user-lo5ws2pm5h 2 роки тому

    好教程,求字幕

  • @samferrer
    @samferrer Рік тому

    Debate about the circle. I say it is a circle with infinite radio ... or you say it is a line (180 deg) ...
    The same debate as in flat earth
    Yet, there is no infinity in computer science...

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    6:33 its not circle then its straight line infinity cant you thing? make point one after another with 0 degree its straight lol, but you cant know you using tau its look better doing 3.14 pi 0.5tau 180degree lol making lines 0.5tau have to become circle nooooh its line

  • @dookcurruff9047
    @dookcurruff9047 2 роки тому

    youre beautiful

  • @purplecat9942
    @purplecat9942 Рік тому

    im fall in love i guess

  • @tyh7388
    @tyh7388 2 роки тому

    It gets funnier and funnier every time photoshop crashes and you curse its name lol sorry not sorry XD

  • @mohokhachai
    @mohokhachai 3 місяці тому

    The hardest thing i all the engine

  • @underfilho
    @underfilho 2 роки тому

    great lecture, but now I'm mad at you because you use τ and not π 😡

  • @numoru
    @numoru 2 роки тому

    hey big head