Trigonometry | Gamedev Math

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 74

  • @macha-leaf
    @macha-leaf ปีที่แล้ว +36

    SOH CAH TOA!

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +6

      I first took HS trig over a decade ago and I STILL do it 🤣

    • @crazyhippo3306
      @crazyhippo3306 10 วันที่ผ่านมา

      OH AH OA
      HO HA AO
      S C T
      😂

  • @mirandaart3012
    @mirandaart3012 7 หลายเดือนก่อน +10

    all of a sudden high school math from years ago finally clicks in (loved watching this!)

    • @NatsuDev
      @NatsuDev  7 หลายเดือนก่อน

      Thank you so much, I'm glad you enjoyed it!

  • @aldobernaltvbernal8745
    @aldobernaltvbernal8745 2 ปีที่แล้ว +23

    i genuinely do not understand how a video this good can have less than 100 views (84 at the time of writing)
    this is a great intro to trig, you deserve way more recognition

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว +2

      Thank you very much, I spend a lot of time deciding how I'm going to cover each topic, so your words mean a lot to me. And why less than 100 views? I guess I gotta start posting on reddit.

    • @Afreshio
      @Afreshio ปีที่แล้ว

      i don't know, the guy talks to fast and the video and speech is not in sync. this is an intro, it shoud be way slower

    • @aldobernaltvbernal8745
      @aldobernaltvbernal8745 ปีที่แล้ว +2

      @@Afreshio don't forget you can always rewind if you get lost! these kinds of videos aren't usually a view-once kind of deal

  • @Leoleonpd
    @Leoleonpd 2 ปีที่แล้ว +13

    The algorithm recommended this to me! Thanks for the helpful video! Your channel deserves so much growth. Good on you

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Thank you for your kind words, I really appreciate it--I still feel like a complete amateur at making videos so hearing that means a lot! And I'm glad you liked the video!

    • @Leoleonpd
      @Leoleonpd 2 ปีที่แล้ว +1

      @@NatsuDev yeah! I was shocked at how few views you had. The quality is really good.

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Yeah, I have to start posting on reddit or something lol! After starting to make these I understand why companies have social media positions--it's just a lot of time.

  • @rohanvishayal8724
    @rohanvishayal8724 ปีที่แล้ว +3

    Underrated af, this is quality content.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Thank you very much!

  • @설리-o2w
    @설리-o2w ปีที่แล้ว +4

    So underrated Please keep making videos its so fun to watch Maths and how its implemented in games :) plus your voice is so relaxing

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +2

      Thank you very much! I've got a few more math videos in the pipeline--one about Quaternions that I've been putting off for TOO LONG!

    • @설리-o2w
      @설리-o2w ปีที่แล้ว +1

      @@NatsuDev Can't wait to see it :) the effort you put into your videos is extremely evident. Good job! And as I've said I can't wait :)

  • @SeanFrancisNBallais
    @SeanFrancisNBallais ปีที่แล้ว +3

    Almost two minutes in, and I knew this would be fun to watch while learning.

  • @dominic_sanchez
    @dominic_sanchez ปีที่แล้ว +8

    This video is great. I think using motion canvas would help increase the quality but I think what you have is charming in its own way. I like how fast paced everything is and still digestible. Younger me would've appreciated this video a lot when learning about trig.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +3

      Huh! Never heard of motion canvas before--next time I make a video like this I'll give it a try. Thanks!

    • @RenderingUser
      @RenderingUser ปีที่แล้ว +4

      ​@@NatsuDevmotion canvas is an epic tool made by another gamedev on TH-cam
      Really cool stuff

  • @juliuswaldmann8682
    @juliuswaldmann8682 2 ปีที่แล้ว +4

    I was also brought here by the algorithm. Normally I am not really the "comment writing person" but I have to say that this video was really well-made, and I had to complement you. I wish you the best of luck going forward.
    You've gained a new subscriber today :)

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว +1

      Thank you! I really did not this video to take off like it did, and I appreciate your kind wishes! I'll keep on putting out the good stuff for you!

  • @theveryloosegoose
    @theveryloosegoose ปีที่แล้ว +1

    Love the video, but one thing has me confused at about 7:20 in the video; what do you mean by using the signs(sines?) of x and y to find Theta? Every way I've thonked about it, I can't figure out how.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Right, so, regular arctangent only ranges from -pi/2 to pi/2, i.e. just 180 degrees instead of the full 360. So if you want to figure out the actual angle you'd have to look at the signs of x & y (whether or not they're positive or negative). Or if you're using a programming language with a math library you should have access to an atan2 function that does all of that for you.

    • @theveryloosegoose
      @theveryloosegoose ปีที่แล้ว +1

      @@NatsuDev Okay NOW i think I get what's happening; you use normal arctan to get the limited -π/2 -> π/2 angle, then find out which quadrant it's in with the x and y, and then just find the angle that shares that tan with the result of arctan. Right?

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      @@theveryloosegoose you got it!

  • @Ra11y
    @Ra11y 2 ปีที่แล้ว +4

    Subscribed! This video gave me the right kind of A level maths flashbacks

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Perfect! I'm trying to hit the highlights of all the topics I cover and show how they can be used. I just want to inspire people who might not like math but are interested in gamedev to give math a second chance.

  • @LighthoofDryden
    @LighthoofDryden ปีที่แล้ว +7

    Ok look the math was fine but I need those macarons

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +2

      Sorry, but I'm afraid they're long gone!

  • @billy6427
    @billy6427 ปีที่แล้ว +1

    Very much Needed

  • @mr_dodex
    @mr_dodex ปีที่แล้ว +2

    Loved this great intro to trig.

  • @_Egg
    @_Egg ปีที่แล้ว +2

    wait what. i thought i was watching a huge youtuber until I heard at the end you were a small one. huh. great job

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +2

      Haha, thanks! It was more true when this video first came out, I think back then I only had roughly fifty or so subs.

    • @_Egg
      @_Egg ปีที่แล้ว +1

      @@NatsuDev very nice. just keep up the quality and youll be golden. I know and respect the grind

  • @brianwaltse281
    @brianwaltse281 ปีที่แล้ว +1

    I may be wrong, but I believe the arc length formula given is incorrect?
    Should be s=r*angle, or s=r* (angle/180) for degrees?
    π * 1 = π so I'll remove it for the unit circle, but as an example, let's try solving for an arc length for the half circle. That could be represented as 180°, 0.5, or π.
    π*π = 2π
    π*180 = 180π (or 2π if we convert)
    π*½ = ½π
    The correct answer is a length of π of course. Or, alternatively, 180.
    I may be misunderstanding though.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Mea culpa! Yes, the formula for arclength in radians would be arclength(theta) = radius * theta & if you want it in degrees it would be arclength(degrees) = radius * pi * (degrees/180). I think I had a brain fart while writing out the formula while listening my VO.

  • @xx_gotadam_xx9457
    @xx_gotadam_xx9457 ปีที่แล้ว +1

    This is genuinely so helpful tysm

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Glad to hear it 😄

  • @streamdx
    @streamdx ปีที่แล้ว +1

    I think you can convert shoot direction vector to a unit vector(vector of length 1) then you don’t have to use sin and cos in order to achieve same bullet speed in all directions.
    Or may be i don’t get your idea… it is also might be computationally cheaper to normalize vector once instead of calling relatively expensive sin() and cos()

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +1

      That's true, you can! But since I cover Linear Algebra & Vectors later on in this series and this video in particular just focuses on trig I didn't want to use a topic I haven't yet covered.
      As to what's computationally cheaper idk. I'm largely self-taught when it comes to CS. As long as the framerate's high enough I don't really sweat the small stuff.

    • @streamdx
      @streamdx ปีที่แล้ว

      @@NatsuDev i just got your video as recommended, didnt know vectors are not covered yet

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Oh, don't sweat it! I'm gllad you really engaged with the example problem. The earlier ones are more straightforward with more advanced mathematics.

  • @therealaleki
    @therealaleki 2 ปีที่แล้ว +1

    Wow, this is a very good quality video

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Pleased you think so! But Hyper Light Drifter is so stylish it might be making it seem better than it really is ;)

  • @Preview43
    @Preview43 6 หลายเดือนก่อน +1

    I tried. I really tried.... but my brain doesn't math. I remain mathless and trig-poor.

    • @NatsuDev
      @NatsuDev  6 หลายเดือนก่อน

      Any better luck with the Kahn Academy Trig series I linked? I cover the greatest hits of Trig at breakneck pace whereas that series goes at an actually reasonable pace.

  • @YmanYoutube
    @YmanYoutube ปีที่แล้ว +1

    Wouldn't it be easier to use Vector math for the single shot instead of Trig? Just get the direction vector (mouse pos - player pos) normalized and then multiply that vector by your speed value.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +1

      That'd work & be easier for a single shot but since I also wanted to implement a shotgun-style spread as part of the hands-on demo, which requires trigonometry. Plus I cover vectors later on in the series, so I didn't want to use something I hadn't introduced yet.

  • @truelifek9221
    @truelifek9221 ปีที่แล้ว +2

    Me in high school: I will never need trig in the real world. Why do I need to know this?
    Me now: Oh.

  • @octavioaxel8514
    @octavioaxel8514 2 ปีที่แล้ว +1

    What languages are you using?

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว +2

      Honestly, it's mostly psuedocode but I am using the C/C++ pointer symbols. Again, I want this to be the well-meaning shove that gets you to do this stuff for yourself! So use whatever language and/or engine you feel most comfortable with!

  • @arsnakehert
    @arsnakehert ปีที่แล้ว +6

    Would've been pretty funny if at the point where you're typing "circumference" you had typed "circumci..." and then corrected yourself :D

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว +2

      DANG! Missed the opportunity!

  • @TheBunzinator
    @TheBunzinator ปีที่แล้ว +1

    Technical point, but I believe they are macarons, not macaroons. Macaroons are larger soft coconut cookies without filling.

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      im bad at french :(

  • @macronomicus
    @macronomicus 2 ปีที่แล้ว +1

    Those macaroons look great! And, wow you're extremely better at math than I am 😳if it weren't for widely available reference materials & tutorials like this, node-"coding", & code libraries, I think the math stuff would be way out for me, i've spent so little time learning maths except on an as needed or curiosity basis. The way I learn I'd have to dive deep for a long time to get math properly embedded, & mastered would take many years of course. Thats why Ive always been more the type that eyeballs things & tinkers until it feels right. 😜

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว +1

      Oh don't worry, I've spent years practicing & improving my math skills and I know a lotta people who absolutely smoke me. Thankfully for gamedev you can take little bites out of math as needed & there ARE great libraries that help--I'm a big fan node coding also! Whatever lets you get the hard stuff outta the way and lets you make a game! And I'm just as guilty as tinkering & eyeballing things as you are!

    • @macronomicus
      @macronomicus 2 ปีที่แล้ว +1

      @@NatsuDev Hahaha! Thats great to know, thanks for the encouragement. I have dabbled in 3d for years slowly teaching myself as I get time/inspiration, the code area is wild & so unique, ive been dipping my toes into all the areas, only with learning as the goal since I dont often get the chance to use the skills just yet, except maybe in collateral & art for web projects sometimes. I hope to expand at some point though when inspiration strikes. I love seeing vid's like these because its always adding more bits to my mind map of it all. Thanks for posting & I wish you great luck with growing your channel and projects!💚

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว +1

      Thank you kindly! I'm glad I could help fill in the fuzzy parts of your mind map for you--great imagery by the way! It reminds me of how the monsters at the edges of old maps eventually got filled in with the actual geography there.

    • @macronomicus
      @macronomicus 2 ปีที่แล้ว +1

      @@NatsuDev Yea, that is a cool effect for a game map, there's sort of a fog covering it until you explore an area some, I think that helps drive curiosity & keep people playing with a sense of adventure of what may be ahead. I can hardly wait until I have some time to tinker in UE again, its tons of fun creating! Thanks for the inspiration man, I hope your dev stuff is going great!

  • @DrNabeel20
    @DrNabeel20 ปีที่แล้ว +1

    Great video! I enjoyed it a lot, but the background music is distracting and loud :(

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Ah, sorry about that! I always have a tough time dialing it in properly. I'd be happy to give you a pdf of script that includes the equations & works if that'd help☺

    • @DrNabeel20
      @DrNabeel20 ปีที่แล้ว +1

      @@NatsuDev thanks for that, keep making these useful videos and that is all I want 🔥

    • @NatsuDev
      @NatsuDev  ปีที่แล้ว

      Here you go! drive.google.com/file/d/1cSorJdsOIFE0mcWSGR9ADJsPWp-bihtd/view?usp=sharing Let me know if you have any problem accessing the file or any questions regarding the material covered!

    • @DrNabeel20
      @DrNabeel20 ปีที่แล้ว +1

      @@NatsuDev Thanks! 🌹🌹

  • @АндрейКомароми
    @АндрейКомароми 2 ปีที่แล้ว +1

    Great video! Keep doing this. Just smashed the subscribe button)

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Thank you very much! I'll keep on doing the best I can, just don't expect a video on differential geometry anytime soon ;)

  • @uthkarshm6390
    @uthkarshm6390 2 ปีที่แล้ว +1

    e understand tNice tutorialngs in better depth. I didn't even realize i was just scratcNice tutorialng the surface with tNice tutorials DAW. I'm using soft and soft one and I

    • @NatsuDev
      @NatsuDev  2 ปีที่แล้ว

      Glad I could help out, bud! Thanks!