Trigonometry • Math for Game Devs [Part 3]

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024

Комментарии • 119

  • @pogostar1878
    @pogostar1878 Год назад +10

    Extra Timestamps:
    25:57 - Volume
    28:26 - Alt method: Volume/Area using coordinate axis
    59:14 - Arc Length practical example
    1:26:32 - Trigonometry example: Camera FOV
    1:29:53 - atan, algebra
    1:33:41 - Other inverse trig functions (acos, asin)
    1:35:41 - cotangent
    1:36:56 - More visual examples (sin, cos, tan)
    1:41:35 - atan2 initial explanation
    1:53:46 - Why not acos and asin? (Vector to Angle)
    2:03:12 - Sign of an angle
    2:10:44 - Look trigger example
    2:19:17 - Visualizing the look threshold (Look Trigger example)
    2:49:32 - More FOV use-case examples
    3:02:07 - Determinant details
    3:04:18 - Signed Area Explanation

  • @usoppgod8107
    @usoppgod8107 3 года назад +67

    This is gold. Literally gold for game developers.

    • @Inquisite1031
      @Inquisite1031 11 месяцев назад +1

      this is just high school borderline middle school maths, are game developers people who didn't even attend high school ? I'm confused

    • @Pandorarl
      @Pandorarl 10 месяцев назад +2

      @@Inquisite1031a bunch of people including me have not yet completed high school when learning game dev. also a practical understanding of the theory you cannot get from simply solving textual problems

    • @ScienceDiscoverer
      @ScienceDiscoverer 10 месяцев назад

      @@Inquisite1031 You should realise that most of the middle/high-schools in the world are total crap. And have horrible teachers and/or education curriculum. ESPECIALLY for math.

    • @Inquisite1031
      @Inquisite1031 10 месяцев назад

      @@ScienceDiscoverer I mean sure, but u still have to pass ur exams, and the vector algebra and trig u need to learn for that is pretty much what the video covered, maybe slightly less, in my country as far as compulsory education is concerned I expect every1 to know basic trigonometry and basic vector algebra, well that was like 15 years ago, maybe it has changed, xdd

    • @zekrinealfa1113
      @zekrinealfa1113 5 месяцев назад

      @@Inquisite1031 It's been 10 years, I needed a refresher.

  • @realcygnus
    @realcygnus 3 года назад +6

    Radians: PI/2 = 90deg & PI = 180deg etc., is often thE MOST intuitive way of working with things in math/physics that involve circles/rotations/angles IMHO. PI's always manage to come back & bite regardless. Funny you mention plain old turns, I have used them myself but, don't recall ever seeing it used in any libs or anything I ever encountered. & BTW, I really appreciate your knowledge of unity/graphics/shaders/coding in general etc.. Such tuts about modern/relative topics & just brush ups are a gem for an old c cat who just dabbles a bit to keep up on things. 👍

  • @hadarnesher
    @hadarnesher 2 года назад +5

    When i just want to relax and learn and get motivated i watch your lectures, so useful and I'm not a game dev, I'm a 3D artist but everything you teach can be applied so thank so much. I will be glad if from time to time you will show 3d implementions cuz something its harder to think about and sometimes it can not be implemented the same way.

  • @voyageruk2002
    @voyageruk2002 2 года назад +7

    Thought I'd use this video as reference as I'm learning geometry nodes in Blender 3. Ended up watching the whole thing non stop, it was very informative and your delivery is excellent.

  • @c0nsumption
    @c0nsumption 2 года назад +2

    Finally made it to this one. Between studying the heck out of Blender, deep diving into this course taking a lot of notes, and learning the the building blocks of Unity and Unreal, I am completely swamped!

  • @luciovicentini
    @luciovicentini 2 года назад +2

    I'm getting back to my high school's math teachers and tell them that Pi is a piece of garbage, and now I have a really good argument and explantion of why it is.

  • @antonbashkin6706
    @antonbashkin6706 2 года назад +17

    Damn, you're the future of math learning/teaching, this is incredible work

  • @ademolaadenekan6869
    @ademolaadenekan6869 3 года назад +5

    Nice tutorial ! Can you talk about how we can use the trig functions to make primitive shapes like triangle, regular polygon and circle.. I’m sure others will like to know how cool trigonometry can accomplish this

    • @acegikmo
      @acegikmo  3 года назад +3

      that's part of the assignments at the end of this! I talk about how to do it at the beginning of the next video :)

  • @nthnnnnnnnnn
    @nthnnnnnnnnn 3 года назад +8

    (52:00) My preferred explanation for radians is:
    It's the length of the circumference of the angle (on unit circle).
    Which happens to be 6.28.. or 2π or Tau for full revolution.

    • @gutzimmumdo4910
      @gutzimmumdo4910 2 года назад +3

      "It's the length of the circumference of the angle (on unit circle)."
      u meant:
      "The length of the *arc* substended by an angle on the unit circle" ?
      The word circunference is not a part of something, its a whole.
      Arc is a part (substended by a central angle of a circle) of the circunference.

    • @nthnnnnnnnnn
      @nthnnnnnnnnn 2 года назад +1

      @@gutzimmumdo4910 You're right! That's what I meant. Thanks!

  • @rskityaev
    @rskityaev 3 года назад +11

    I see Freya's video, i put thumbs up before i press "play"

  • @DePistolero
    @DePistolero 3 года назад +6

    Perfect!!! What is going on with that math book you were talking about?

  • @supertenchoo4271
    @supertenchoo4271 2 года назад +2

    Thank you Freya this is what i was looking for its "Determinant" I want to fire a rocket but I need to know how exactly I know if the rocket is facing enemy ship ......Thank you Best Game Dev Teacher for math.....I have to Finish the series the value of this Knowledge is Gigantic

  • @ノア-f9o
    @ノア-f9o Год назад

    I followed every step as you showed in the video and i'm very surprised by how this hack works! Thank You!

  • @mathiaspampus813
    @mathiaspampus813 2 года назад +2

    The reason so many things do not make sense to you is the world you confine yourself in. Well established or not, your world is what is flipped and twisted, you should appreciate that and deal with it instead of complaining. One would think you'd be a bit more openminded... But let's not argue, just take a look at this:
    The order is sine, cosine because the sine function is the base for the "co-sine" function. Of course this doesn't match your x, y order, but consider a world where 0° is 'up' and rotation taking place in a clockwise manner. In this world you'd find that sin(α) gives you the x-component and cos(α) the y-component. And guess what - atan2 takes x as the first argument in that world. Also, that's where I've lived for most of my life. Boy, was I confused when I first got into openGL, where everything was rotated on the side and then flipped on its face.
    I mean you should just adapt and appreciate that things are not the same for everyone, everywhere. Just because something doesn't fit well into your scheme of things doesn't mean it's wrong, right?

    • @mathiaspampus813
      @mathiaspampus813 Год назад

      Yes, it is a quirk. The math ist not stupid but perfectly fine, that's what I'm saying.
      It just doesn't fit so we'll in that world where axes are swapped. This is where the quirk lies, not in the order of function arguments.
      So what I meant is that she didn't seem to know, nor care that there's reason for those things. And by deal with it, I meant actually dealing with it; making it no longer be a problem, in whatever manner comfortable to her. Maybe my first comment seemed a bit harsher than it was meant to, so here's an apology for that.
      Just don't call a thing stupid, when you don't know why it is the way it is. It might not be stupid after all.

  • @voxeledphoton
    @voxeledphoton 6 месяцев назад +1

    1:34 bruh sneezed on the cat

  • @TheRabidCabbage
    @TheRabidCabbage 3 года назад +1

    The Furry God of Thunderous Meows requires sustenance.

  • @SamuraiExecutivo
    @SamuraiExecutivo Год назад

    18:20
    The dot product between AB (b-a) and AC (c-a) wouldn't give you the height of the triangle?

  • @Chris_t0
    @Chris_t0 3 года назад

    It seems your turret forward vector code is incorrect, just letting you know, i mean it works on flat surfaces but not slopes, by cross producting it with a sloped normal, it no longer points in the look direction of the camera (or whatever origin ray was used)

  • @naknuknik
    @naknuknik 2 года назад

    For the first problem:I made an overcomplicated solution where i got the "local space" basis vectors at the rayhit and did a bunch of dot products. Feling very dumb after seeing the easy solution.

  • @josephfdunphymba3241
    @josephfdunphymba3241 10 месяцев назад

    What program is being used to illustrate?

  • @AlfredReinoldBaudisch
    @AlfredReinoldBaudisch 2 года назад

    We need a poster with: "Nothing is consistent, everything is garbage" - Freya Holmér

  • @Sovereing2027
    @Sovereing2027 8 месяцев назад

    1:12:20 How to make a square out of this at this point?

  • @akuoko_konadu
    @akuoko_konadu 3 года назад +1

    Dis is so good.

  • @rogerrabbit2913
    @rogerrabbit2913 Год назад

    I'm not a game dev by far. I've been trying to figure out how to code a simple plane ai for a game called From the Depths lol. Been trying to figure out how to get a plane to roll left or right depending on target bearing.

  • @JamesCarolan1993
    @JamesCarolan1993 Год назад

    Thank you for your help 😊

  • @Kullervo456
    @Kullervo456 3 года назад

    Recently watched and enjoyed the talk. At the 10:40 mark a reference to a document on How Meshes Work and how they are structured. Curious to know if that link is still available?

  • @chivuchivu
    @chivuchivu Год назад

    'My friend's name is Pi' 'Fuck that person' lollllll

  • @wallbrick2170
    @wallbrick2170 2 года назад

    4:20 If I was to do a quick cheap technique, I would just grab the vector, put the source at where it needs to hit the surface and multiple vector.y by -
    😂

  • @eongft4027
    @eongft4027 3 года назад

    Is there a video missing between part 2 and part 3?can any one help?

  • @justadamazing
    @justadamazing Год назад

    "triangles - are they for you?" Geometers HATE this one simple TRICK!

  • @ScottHost
    @ScottHost 2 года назад

    I like Trig Too

  • @spydacarnage
    @spydacarnage Год назад

    Late to the party, but maybe PI won because πr² for circle area is easier than ½TAU·r² ?

  • @kellybmackenzie
    @kellybmackenzie 2 года назад

    YOU'RE FUCKING AWESOME and a huge inspiration to me!!

  • @terdengarwe6957
    @terdengarwe6957 3 года назад

    2:23:48
    how to show that arc line on game mode?

  • @UML649
    @UML649 3 года назад +5

    Drawing straight line in photoshop: hold shift and just click any two positions on your canvas.

  • @realcygnus
    @realcygnus 3 года назад

    BIG fan of calling inconsistencies & aggravating things "garbage" myself, pronounced gabbage. 🤣

  • @terakiki5767
    @terakiki5767 2 года назад

    Asgmt. 4 i didn't undertand how subract between ray and 2 * dotProduct(ray,n) * n give a mirror ray dir

  • @diogoduarte4097
    @diogoduarte4097 Год назад

    They say there aren't any dumb questions, but surely there are questions that frustrate me and make me wonder if you were dropped as a baby.

  • @muthu1593
    @muthu1593 3 года назад +1

    1:53:38 Could you send me your math library?

    • @acegikmo
      @acegikmo  3 года назад +3

      github.com/FreyaHolmer/Mathfs

  • @JarppaGuru
    @JarppaGuru 2 года назад

    54:36 Or pI2 right Xd put second line for tau it become tau2 as pi but then full circle is pi2. not logic right lol

  • @jmferrari1343
    @jmferrari1343 3 года назад

    amassava

  • @movgto3392
    @movgto3392 7 месяцев назад

    I'm just going to leave a time mark where I stopped at 1:01:00

  • @JarppaGuru
    @JarppaGuru 2 года назад

    1:13:23 still too same calculations

  • @soogoonu
    @soogoonu 3 года назад +1

    I like pies

  • @alexanderd.9954
    @alexanderd.9954 Год назад

    no, i like pi xd

  • @markmanning2921
    @markmanning2921 3 года назад

    NEVER apologise for having a sense of humor even when it might offend someone.
    You do not have the right to not be offended...
    -- The Bill of NO Rights --
    :)

  • @angeldotexe1337
    @angeldotexe1337 9 месяцев назад +3

    Why is this dude putting on that wierd voice.

    • @pipacombate393
      @pipacombate393 7 месяцев назад +1

      Nuh uh that's clearly a woman. But it's aight lil bro, I know for a fact you don't have much contact with women so you frequently mistake em.

    • @CC3GROUNDZERO
      @CC3GROUNDZERO 5 месяцев назад +1

      @@pipacombate393 Women are people with XX chromosomes. That biological man in the video is not a woman.

  • @kerrybrown1192
    @kerrybrown1192 3 года назад +11

    "anyway, I went off on a tangent ... "
    very punny, and delivered with a straight face :)

  • @ThoughtsOrange
    @ThoughtsOrange 2 года назад +2

    I want to yeet that cat out the window

  • @timbachelder9871
    @timbachelder9871 Год назад +2

    Thank you for this content!! I have been struggling on some math for several weeks now, never touched trig in my life and you were able to help me with the math I needed for my functions!! Amazing!!!

  • @JarppaGuru
    @JarppaGuru 2 года назад +1

    57:29 tau is coming from pi not other way lol.

  • @trackhero2714
    @trackhero2714 3 года назад +3

    I would never have figured that reflection assignment out on my own, but after the explanation it makes sense....guess I have a lot of practice to do!

    • @Chris_t0
      @Chris_t0 3 года назад

      yeah that was crazy assignment i still dont understand it after the explanation at all

  • @TimRex.
    @TimRex. 3 года назад +2

    I'm wondering if perhaps part of the reason Pi is more ubiquitous than Tau is because those inverse trig functions only really work unambiguously within the first two quadrants (eg: Where the angle is < Pi radians). I'm not saying that it's a good reason of course.

    • @King-mj2bn
      @King-mj2bn 2 года назад +3

      I'd say it's simply a matter of habit. A long, long time ago it was much easier to measure the diameter of a circle than its radius. The concept of π is rooted in thousands of years of tradition and thus, by extension, is rooted in thousands of years of mathematical discoveries.

  • @workflowinmind
    @workflowinmind 3 года назад +2

    Congrats on the apartment girls!

  • @michaeldamolsen
    @michaeldamolsen 2 года назад +1

    @2:01:55 I just wanted to mention that the range of arcsin (asin) is -1/4 turn to +1/4 turn, -90 to +90 degrees, -tau/4 to +tau/4 ( -pi/2 to +pi/2). That is in fact how atan2 can recognize the quadrant. If the vector is in the lower right corner, acos is positive and asin is negative. Similarly for the other quadrants, the signs of asin and acos are different so the correct quadrant can be determined. If asin had a range of 0 to 1/2 turn, then that would not be possible as the sign would always be positive, and thus not give the required additional clue for the quadrant.

  • @JarppaGuru
    @JarppaGuru 2 года назад +1

    1:12:55 TAU = Math.PI*2f if not use anywhere else thats where it should be

  • @inex550
    @inex550 2 года назад +1

    Hi o/ Where i can download sketches from the video? It will be helpful for my conspects of vector algebra. Thanks)

  • @mikakalkainen6210
    @mikakalkainen6210 Месяц назад

    I'll admit that I was pretty scared about my math skills when I started my own game about month ago. My math teachers in every educational level have been shit to worse. But then at my work suggested this tutorial here and oh boy. You girl are pure gold! I now understand everything so clearly thanks to your super educational tutorials. Thank you so much!

  • @destroyerdev6650
    @destroyerdev6650 2 года назад

    I am a Mathematician and Philosopher; (I hate Mathematicians and Philosophers) All they do is {arg}ue about everything ! Alexander Grothendieck is insane because of everything you say and do, has so be a debate about semantics, context, and preconditions. {1}

  • @rheemboi
    @rheemboi 3 года назад +1

    Thanks so much I now have better understanding about angle or just game Dev maths

  • @randomrandom450
    @randomrandom450 3 года назад +1

    Did you or could you make a video about quaternion math and how to use it in games ?

  • @TheMustachioedJames
    @TheMustachioedJames Год назад

    Can't you just go y=dot(n, ray), and jump to yreflection=(-y), rather than multiplying by 2?

  • @hades5444
    @hades5444 3 года назад +1

    amazing that such content is for free :O

  • @dwarkeshbodana7365
    @dwarkeshbodana7365 3 года назад +1

    My school days have come to haunt me.

  • @devil2005iscool
    @devil2005iscool Год назад

    she is gorgeous

  • @JarppaGuru
    @JarppaGuru 2 года назад

    1:18:23 makes sence radius is 1 LOL lets use dot so we can choose radius lol. i not want game with allways 2Meter circles xD

  • @yungquagton
    @yungquagton Год назад

    we support you

  • @JarppaGuru
    @JarppaGuru 2 года назад

    1:20:03 are you sure? is that normalized vector A allready hold x and y what you about to calculate lol

  • @voidconcepts
    @voidconcepts Год назад

    Public education is criminal. This was infinitely easier to understand than going through the nonsense of math.
    Everything made sense until we started bluring the area between the contextual idea of length and distance.
    You'll get lost if you forget these are all VECTORS with a DIRECTION. In terms of algebra we don't really care.
    And I feel like the tangent segment started to slip into that area where vectors are not talked about.
    The animation does not make sense algebraically. Because you are asking why the tangent Shrinking is...well if you look at the tangent being a LINE it doesn't make sense but when you remember the tangent IS a vector...that is dependent on other vectors it makes sense.
    I was going to hop back in engine after 2 but I think I'm just going to keep watching for a bit more.

  • @saasrus
    @saasrus Год назад

    Error. Tangent is cos to sin ratio if you doing algebra, and raycasting of angle vector to (Y-inf to +inf) line going though (X=1.0f). Illustrated in this video kinda tangent must have a hole between -1 and 1, but it continuous in that range.

  • @fwdflashwebdesign
    @fwdflashwebdesign 10 месяцев назад

    The colors that you choose are really appealing to the eye :)

  • @rosyfu5845
    @rosyfu5845 2 года назад

    what about the bonus challenge?:) Spent an entire night on "make an object move along the bounced path at a fixed speed when you press play" but can't get it to work properly... wonder if we can get some insight on that

  • @Arahansannihilation
    @Arahansannihilation Год назад

    Good names for kids. "Come here Sin!" Go tell your brothers Cos and Tan they're grounded for confusing the masses."

  • @JarppaGuru
    @JarppaGuru 2 года назад

    57:36 no its pi2 so you cant take 0.25*2 LOL pi is in midle

  • @gustorvo
    @gustorvo 3 года назад

    Trying to follow up by concentrating, but the cat's meowing i abstractive...Anyway, your explanations is great no matter what!

  • @rwells242
    @rwells242 2 года назад

    Good day in your Trig class would tan be the equivalent of the Z value, basically how to extend to Vector3

  • @hero_big9234
    @hero_big9234 3 года назад

    Hi Freya. . . I nerd other oportunity. . Can You send me your Discord link?.

  • @absolud
    @absolud Год назад

  • @SciHeartJourney
    @SciHeartJourney 2 года назад

    Oh man, this woman codes so fast!
    I think she move a little bit slower so that we can learn from her.

  • @celtavanyname5400
    @celtavanyname5400 3 года назад

    My reflection in a window: how many dimensions and con
    variables are there ?

  • @DEFICITGames
    @DEFICITGames 2 года назад

    You're brilliant!

  • @AJ213Probably
    @AJ213Probably 3 года назад

    Does the determinant thing work in 3D? I remember there is an equation for that in 3D. I actually have needed this in 3D to keep a physics object on a track using physics. If it's to the right of the path push it to the left to keep it on and so on.

    • @acegikmo
      @acegikmo  3 года назад

      the determinant generalized to 3D is the wedge product, which is also similar in spirit to the cross product

  • @supertenchoo4271
    @supertenchoo4271 2 года назад

    Thank you Freya you are the best teacher

  • @bossboy1377
    @bossboy1377 3 года назад

    I was looking fir something like this

  • @baphnie
    @baphnie 2 года назад

    Just found your channel, and it's SO helpful!

  • @갱스터깍지
    @갱스터깍지 Год назад

    이것을 긴 시간동안 가르치는 당신은 대단합니다 ^^

  • @BillyPoncho
    @BillyPoncho 3 года назад

    freya you are the best. Thanks alot

  • @GankablePlayer
    @GankablePlayer 2 года назад

    Thank you so much for the course!

  • @zekunyang4686
    @zekunyang4686 3 года назад

    Really good

  • @realcygnus
    @realcygnus 3 года назад

    Nifty !

  • @synth32
    @synth32 3 года назад

    "atan" and "atan2" is the same, with "atan" u need to give one input which is the slope (y / x) and with "atan2" u don't need to divide yourself and just give y and x as an input (the "2" just stands for 2 inputs). I also thougth for a long time that "atan2" is something special^^

    • @King-mj2bn
      @King-mj2bn 2 года назад +2

      You are incorrect, atan2 does more than just atan(y/x). It runs a check to determine if cos(α) is negative and adds pi to the result if it is. If you used simply atan(y/x) you'd have to assume that your coordinates DEFINITELY reside in quadrants I or IV. If they didn't, you'd end up with results you don't expect.

    • @phizc
      @phizc Год назад

      @@King-mj2bn Doesn't it just check whether x is positive and negative? That's the only thing needed to check if it's in quadrants 2 or 3 instead of 1 or 4.. (1 being positive X and Y).
      float atan2( float y, float x ) => atan( y / x ) + 0 > x ? PI : 0;

  • @farvardinmainyu1961
    @farvardinmainyu1961 3 года назад +2

    π is not good enough, long live τ !

  • @saintlime
    @saintlime 3 года назад

    Hey Freya, I really like this series, extremely helpful and my mind has definitely been blown a couple of times, especially with the relationship between tau and the unit circle. This will help me a lot in the future, so many thanks from me :)
    The only criticism I have is that Thor's meowing can be distracting and annoying at some times. If you're doing more of these types of videos, I'd take that into account.
    Otherwise perfect video, keep them coming! :)

  • @victorvoiz8839
    @victorvoiz8839 3 года назад +1

    First