Trigonometry • Math for Game Devs [Part 3]

Поділитися
Вставка
  • Опубліковано 21 лис 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 4 роки тому +67

    This is gold. Literally gold for game developers.

    • @Inquisite1031
      @Inquisite1031 Рік тому +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 Рік тому +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 11 місяців тому

      @@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 11 місяців тому

      @@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 7 місяців тому

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

  • @mikakalkainen6210
    @mikakalkainen6210 2 місяці тому

    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!

  • @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.

  • @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!!!

  • @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. 👍

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

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

  • @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.

  • @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!

  • @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.

  • @antonbashkin6706
    @antonbashkin6706 3 роки тому +17

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

  • @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!

  • @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

  • @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.

  • @rskityaev
    @rskityaev 4 роки тому +11

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

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

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

  • @ノア-f9o
    @ノア-f9o Рік тому

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

  • @voxeledphoton
    @voxeledphoton 8 місяців тому +2

    1:34 bruh sneezed on the cat

  • @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 :)

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

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

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

    amazing that such content is for free :O

  • @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 2 роки тому

      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.

  • @DePistolero
    @DePistolero 4 роки тому +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

  • @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.

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

    Thank you Freya you are the best teacher

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

    we support you

  • @갱스터깍지
    @갱스터깍지 Рік тому

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

  • @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.

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

    Thank you so much for the course!

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

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

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

    You're brilliant!

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

    Thank you for your help 😊

  • @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.

  • @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;

  • @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 3 роки тому +1

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

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

    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

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

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

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

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

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

    The Furry God of Thunderous Meows requires sustenance.

  • @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)

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

    Really good

  • @akuoko_konadu
    @akuoko_konadu 4 роки тому +1

    Dis is so good.

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

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

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

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

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

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

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

    freya you are the best. Thanks alot

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

    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.

  • @UML649
    @UML649 3 роки тому +5

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

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

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

  • @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)

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

    I was looking fir something like this

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

    Nifty !

  • @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?

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

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

  • @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 -
    😂

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

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

  • @Sovereing2027
    @Sovereing2027 10 місяців тому

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

  • @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² ?

  • @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}

  • @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! :)

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

    What program is being used to illustrate?

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

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

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

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

  • @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

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

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

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

    My school days have come to haunt me.

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

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

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

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

    I want to yeet that cat out the window

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

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

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

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

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

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

  • @workflowinmind
    @workflowinmind 4 роки тому +2

    Congrats on the apartment girls!

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

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

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

      github.com/FreyaHolmer/Mathfs

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

    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.

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

    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

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

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

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

    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

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

    amassava

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

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

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

    1:13:23 still too same calculations

  • @movgto3392
    @movgto3392 8 місяців тому

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

  • @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.

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

    I like pies

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

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

  • @farvardinmainyu1961
    @farvardinmainyu1961 4 роки тому +2

    π is not good enough, long live τ !

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

    she is gorgeous

  • @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.

  • @alexanderd.9954
    @alexanderd.9954 Рік тому

    no, i like pi xd

  • @victorvoiz8839
    @victorvoiz8839 4 роки тому +1

    First

  • @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 11 місяців тому +3

    Why is this dude putting on that wierd voice.

    • @pipacombate393
      @pipacombate393 9 місяців тому +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 7 місяців тому +1

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