Game Math Theory - SINE WAVES

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

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

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

    holy wow, years of school and I finally understood the sine function in a 4:20 min video.

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

      So you just didn't pay attention in school then?

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

      @@squeakybunny2776 schools are like drugs made to cure all diseases in one pill.

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

      Was it your " high"-school?
      Like brackeys said. I need to get out more...

    • @roseywolf7867
      @roseywolf7867 3 ปีที่แล้ว

      For real though

    • @jay-tbl
      @jay-tbl 3 ปีที่แล้ว

      @@squeakybunny2776 yeah I can't believe it when I see comments like this, did your teacher suck that badly?

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

    "thats just a theory, a game math theory" dam that got me laughing XD

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

    I instantly thought of Game Theorists as you said "Hey, thats just a theory" and i grinned as you really did this joke ^^

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

    I was pretty skeptical about a 4 minute sine function video. However you did a great job explaining the basics and still got straight to the practical usage! Good job ;-)

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

    It would be super interesting to have a video about Quaternions. Keep the great work going :)

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

      yes, quaternions!

  • @bradzepfan
    @bradzepfan 5 ปีที่แล้ว

    this video deserves SO MANY MORE VIEWS than it has current has! This is the most simple, elegant and easy to understand explanation of this concept I have seen ALL OVER TH-cam. And trust me I have looked at hundreds. The game title must be throwing it off on searchs. But millions of people in high school and college and needing to learn this concept. Maybe the video producer can post an alternative title to this video to help in searches.

  • @Anthony-cn8ll
    @Anthony-cn8ll 8 ปีที่แล้ว +6

    A really good use for sine and cosine waves is with an orbiting camera around an object, even if it's moving. In your game loop, take the rotation transform on one axis of the camera and store it as radians in a variable. For example, if your object moves on the X-Z plane, store the rotation about the Y axis. Then find both the sine and cosine of the angle and store those in a variable. The new position of the camera can now be defined by adding these vectors: (Orbital Radius * Sine of the Angle, Y Position of Camera, Orbital Radius * Cosine of the Angle) + (X Position of Object, 0, Z Position of Object).
    You can find the orbital radius by figuring out the initial distance between the camera and the object. You can make the camera orbit by changing the Y axis rotation over time, either automatically or in response to some input.

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

    I would love a video about how you manipulated that plane mesh to create a wave.

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

      Have a look at the standard water assets in Unity! :)

    • @userlink-12
      @userlink-12 6 ปีที่แล้ว

      That's just a simple shader I assume

    • @magnusm4
      @magnusm4 5 ปีที่แล้ว

      th-cam.com/video/3MoHJtBnn2U/w-d-xo.html
      I did this video last year, it was neat to do it all through code :3

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

      Probably used perlin noise

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

      I'm thinking of that procedural mesh generation thingy he made a video for but plug a sine wave in the y instead of just noise

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

    Nice ^^ i would love to see one of these about Quaternions :D

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

      Even Brackeys doesn't really understand Quaternions!
      Hell, even the ppl who invented them don't understand them and just made the functions Quaternion.Euler and the inverse function!

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

      Like... the people who invented them were like... 'It works.. but why?.. NO! DON'T TOUCH IT, LEAVE IT AS IT IS!!'

    • @HYBRIDER-YT
      @HYBRIDER-YT 6 ปีที่แล้ว +1

      Swyse Official We are just inferior beings that will never truly understand Euler's advanced concepts.

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

      Brackeys left the chat

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

      @@HAWXLEADER The Inventor of the quaternions was so happy about his discovery that he carved it into a bridge. (Broom Bridge)

  • @khevan5277
    @khevan5277 4 ปีที่แล้ว

    Can you PLEASE continue this series? It is so well explained and I'm sure it will immensely help any aspiring gamedev

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

    dude you're so gosh darn good at teaching, it's insane! TY TY TY

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

    How can I possibly thank you enough, I just so wanna hug you right now!!!

  • @Codedin97
    @Codedin97 7 ปีที่แล้ว

    ok during Highschool I had trouble understanding Sin curves (Cos and Tan Ones aswell) your video just made it Click thanks so much.

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

    this series is awsome keep it up

  • @SinanAkkoyun
    @SinanAkkoyun 8 ปีที่แล้ว

    OMG WHAT IS THAT FOR GREAT QUALITY?!?!?! You deserve 1.000.000 subs or more!

  • @darknessgaming64
    @darknessgaming64 8 ปีที่แล้ว

    Very informative and fun series to watch, giving examples on how to apply maths learned in high school for example to your games. Keep it up!

  • @thedoctor5036
    @thedoctor5036 4 ปีที่แล้ว

    BRO !! u are so perfect when u come to explain math !!

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

    Ha! I loved the bonus fact about the beep sound! Well done!

  • @SilentLesch
    @SilentLesch 8 ปีที่แล้ว

    Thank you for the video.
    Next time please explain to us:
    - Quaternions;
    - Perlin noise;
    - Different sorting algorithms (I mean effective ones like QuickSort and HeapSort, not the Bubble);
    - Pathfinding algorithms (Dijkstra and other company of travelling sale agents).

  • @developmental3273
    @developmental3273 8 ปีที่แล้ว

    You actually explained it way better than my physics teacher did back in the day. (For those that wonder: yes, I really ment physics teacher)

  • @suraiya21
    @suraiya21 5 หลายเดือนก่อน

    u saved my life. Thank you.

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

    Awesome video!
    Nothing new that I didn't know but still a very nice, informative and quality made video.

  • @mio-xh1ln
    @mio-xh1ln ปีที่แล้ว

    you're godsent, I finally understood it!! 😭🖤

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

    PLEASE! BY GOD EXPLAIN QUATERNIONS! even my Math teacher doesen't know anything about them

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

      Quaternions are difficult because they're part real numbers and part imaginary numbers (in the form w + xi + yj + zk, where w, x, y, z are real numbers and i,j,k are imaginary numbers). Interestingly, sine is related to the value of the imaginary numbers because the power functions of i,j or k will evaluate (using i as an example) to 1, i, -1, -i ... just like the rotation through the unit circle in this video. The difficult thing with explaining/understanding Quaternions is that they are fundamentally abstract and you can't really point to something and say "See, that's a quaternion in action" (but you can kinda point at everything and say it... such is abstraction). How they work (or how they can be understood to work in practice) depends entirely on what you're using them for.

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

      Everything he says here is related to math, and not necessarily game development. You can find many tutorials about Quaternions if you don't wanna wait. They won't tell you how to use it in game development (or 3D art, in this case), but they will tell you about how Quaternions work, and then you can assume how to use them in whatever you want to know them for (there might be some tutorials that talk about them specifically for 3D stuff, I didn't check, but there are MANY that talk about them as a math topic).

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

      Brackeys makes it easy to understand so I would like him to cover the topic in relation to the transform component or something like that. But I appreciate the comments. Also in a video about making a minecraft clone in unity within a week I saw how he used something that looked like it used a sin wave: Could somebody explain to me how you would use sin waves in world generation?

    • @oraviram
      @oraviram 8 ปีที่แล้ว

      Blue Shadow Because when using Perlin Noise, it asks for a value between 0 and 10, where 10 is white and 0 is black (those are values which will be used later to generate the height, white is the most bumped and 0 the lowest). I am not actually sure why a sine wave, though, since it goes between -1 to 1. The best way is to perlin noise is using Lerp, not sine, so I am not sure... I am probably wrong and you saw sine in a different context. Can you send me the video where you saw it? I am probably wrong, but I don't want the things I wrote to go to waste, so I will keep them...I just want to give you a correct answer.

    • @thatKurtis
      @thatKurtis 8 ปีที่แล้ว

      on second thought it may not have been sin at all

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

    "that's just a theory!" that alone made me sub

  • @mooselover308
    @mooselover308 5 ปีที่แล้ว

    This helped so much you’re actually the best

  • @hylianfreak
    @hylianfreak 8 ปีที่แล้ว

    I finally understand Sine. Thanks for all the awesome, and informative, videos~

  • @spectrumbenc
    @spectrumbenc 7 ปีที่แล้ว

    Really useful to show to students - thank you, Arun.

  • @matthewspence7476
    @matthewspence7476 6 ปีที่แล้ว

    Also, except for tan and cosine, the coefficient of sine in a wave function will always produce some sort of exact outline, in x^2 you get plus or minus x^2 as the outline but in x^2+3x-4 the wave function pretty much follows the line, it’s super cool...

  • @Rajiblaze
    @Rajiblaze 5 ปีที่แล้ว

    So much I can do with such a simple function. Thanks for the video!

  • @TheYiffingAtheist
    @TheYiffingAtheist 8 ปีที่แล้ว

    I took Trig and never understood where they got the x's and y's of the sin cos and tan functions. Now after one video I finally get it.

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

    this part 2:04 saved my life now i compeletley know what is it

  • @MrSlug1992
    @MrSlug1992 8 ปีที่แล้ว

    Wow this was awesome. I wish you were my calculus teacher in varsity. Things would've been a lot more interesting. Keep up the great work.

  • @johngrey5806
    @johngrey5806 7 ปีที่แล้ว

    1:22 "THE UNIT CIRCLE!! I need to get out more..."

  • @JuanMolina-tl2xc
    @JuanMolina-tl2xc 4 ปีที่แล้ว

    Amazed that his most useful videos have less likes than other not so important vids

  • @veecel
    @veecel 7 ปีที่แล้ว

    Quick to the point and well done. Thank you!

  • @hamzanasir1590
    @hamzanasir1590 4 ปีที่แล้ว

    Best Explanation Sir 👍👍👍

  • @tingleoncrack2167
    @tingleoncrack2167 6 ปีที่แล้ว

    How would you use the sin wave to move an enemy? Would it work in a way that each foot would move based on the wave? So right foot would move at 1 and left at -1?

  • @peterluxus7382
    @peterluxus7382 4 ปีที่แล้ว

    3:30 laughing and spilling my coffee out on the table

    • @vakqdev
      @vakqdev 3 ปีที่แล้ว

      ha

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

    Underrated channel

  • @nope-xh8tb
    @nope-xh8tb 8 ปีที่แล้ว +5

    Nice game theory refrence

  • @sebastiancuitino
    @sebastiancuitino 6 ปีที่แล้ว

    Great video, we need move math theory videos!

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

    I have viewed these as shapes which I can use to permute other shapes for a long time now.

  • @marcoseliasmep
    @marcoseliasmep 6 ปีที่แล้ว

    This function is awesome, thanks a lot!

  • @ergeorgiev
    @ergeorgiev 8 ปีที่แล้ว

    Awesome, thanks! I never knew how time manipulation was done in video games.

  • @lamwlgabriel
    @lamwlgabriel 8 ปีที่แล้ว

    Important question. I was developing a microsoft visual studio in C# language. I had to make the obstacles fly in a sine wave function. Where the y coordinate was a sine function of time. Because the product is a long float. eg 3.1556778, the positions only work with integers. Else the motion would look buggy. Do you have a solution

  • @NyleLevi
    @NyleLevi 6 ปีที่แล้ว

    Thanks for the video! If we want to have our object float up and down but from a starting point of say 3 on the y axis, how could we do this please? Sine always throws the object back to 0 as a starting point

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

    I liked the way u pronounce Arun Mehta

  • @joaocosta7981
    @joaocosta7981 8 ปีที่แล้ว

    I actually love these. Can you cover quaternions next?

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

    matpat in the corner thinking about making math theory

  • @in5pector688
    @in5pector688 7 ปีที่แล้ว

    Funny, I learnt it in my Russian school when I was 13, but Brakeys explained sin more interesting than in my school.

  • @funfair11
    @funfair11 8 ปีที่แล้ว

    question : if i have multiple object need to move like the coin, is it better to write a script use sin(t) on all these object, or simply create an animation for them? which 1 is better in term of performance?

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว

      If you really care about performance, or have a large amount of objects you could do one trick - create one script which calculates sin value each game frame and stores it into a public static variable. Then, on all objects just read variable value and apply it to the transform. Another, better approach - create some kind of animation manager (fancy name for a regular c# script :) ), store references to moving objects in it, each update calculate sin, and with simple for loop apply offset to the transform. This way you only do sin calculation once as opposed to n, where n is the number of objects. This, however, will make all the objects move sinchronously,and if you wish to de-sinchronize movement you'll still need to calculate sin per object with different time offsets.

    • @dmitrij34
      @dmitrij34 8 ปีที่แล้ว

      Sorry BTW for my English, I hope I haven't confused you :)

    • @funfair11
      @funfair11 8 ปีที่แล้ว

      Thanks for the tips, the explanation was pretty clear, but i'm still curious if a script or an animation would be better, there might be the case all object need to be animate independently.

  • @weplaydthis
    @weplaydthis 8 ปีที่แล้ว

    Love this series. It really deserves more views. Still would love to see an episode on dot product.

  • @zekiozdemir420
    @zekiozdemir420 3 ปีที่แล้ว

    Wow I learned something new Thanks

  • @TEDYGAB
    @TEDYGAB 8 ปีที่แล้ว

    Great video, really well made.

  • @caidenbond1988
    @caidenbond1988 4 ปีที่แล้ว

    Can sine functions oscillate between desired outputs or it is fixed between -1 and 1?

  • @aelliixx
    @aelliixx 8 ปีที่แล้ว

    I like the editing!

  • @boredduck231
    @boredduck231 3 ปีที่แล้ว

    smol brackeys: "that just a theory, a game math theory"
    big brackeys: Leaves us 😭😭

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

    lol I'm 12 so now I get to be ahead of my maths class by a couple of months

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

      nope. by a couple years. been there still there

    • @Groggpuffar
      @Groggpuffar 8 ปีที่แล้ว

      NoobStudios, why so negative?

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

      I'm not being negative. Did you even read my comment?

    • @Groggpuffar
      @Groggpuffar 8 ปีที่แล้ว

      NoobStudios Atleast he's being positive over something and you come with your negative attitude towards his comment.

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

      Why do realise i was not being negative? I was saying he was ahead of his class by years instead of months...

  • @henriquemorato
    @henriquemorato 8 ปีที่แล้ว

    Awesome explanation

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

    Im in class and the game theory joke almost made me laugh out loud 😂😂

  • @christopherodunlami3001
    @christopherodunlami3001 8 ปีที่แล้ว

    learning game development and pre-calculus

  • @seifmustafa2004
    @seifmustafa2004 7 ปีที่แล้ว

    is there anyway to use sine waves to make certain level. patterns like sky force (a space shooter game)?

  • @youssefgaaloul
    @youssefgaaloul 3 ปีที่แล้ว

    Me after seeing Geogebra: "Yeaaah Baby! Thats exactly what I've been waiting for.

  • @MrFrostCA
    @MrFrostCA 6 ปีที่แล้ว

    It is possible to create a Sinus rhythm (Heart beat) with sine waves in Unity?

  • @HideoGojira
    @HideoGojira 8 ปีที่แล้ว

    you are my hero, keep it up!

  • @torsten9983
    @torsten9983 6 ปีที่แล้ว

    Very Good Video beside Game Development

  • @ezequielcorrea5240
    @ezequielcorrea5240 3 ปีที่แล้ว

    miss u brackeysssss

  • @zach8901
    @zach8901 8 ปีที่แล้ว

    Off topic question:
    Can you try to recreate the iOS game Impossible Road, in unity?

  • @Terf1988
    @Terf1988 6 ปีที่แล้ว

    I wish you'd do more of this series! Why'd you stop?

  • @0000Samir
    @0000Samir 6 ปีที่แล้ว

    what software are you using? looks amazing for learning

  • @AZZAMNO1
    @AZZAMNO1 8 ปีที่แล้ว

    So many possibilities from just sin(t)!!! You could make repeating animation and stuff.

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

    3:33 LOL!! Quaternion pelease!!!

  • @duramirez
    @duramirez 4 ปีที่แล้ว

    Feeling enlightened thank you Master hehehe

  • @subscribeordiediepls4437
    @subscribeordiediepls4437 4 ปีที่แล้ว

    Whats the name if the program used to draw the sine waves??

  • @g4xx0r
    @g4xx0r 7 ปีที่แล้ว

    Instant subscribe.

  • @TravelWithDhami
    @TravelWithDhami 8 ปีที่แล้ว

    I have one word for you my friend "AWSOME" if you could make something on quaternions , physics simulation of vehicles like wheel colliders that would be of great help thanks any was great video

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

    1:45 what the name of that program?

    • @AlecAndersonZx
      @AlecAndersonZx 7 ปีที่แล้ว

      I looked around for a bit and I THINK the program is called SageMath

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

      TRIBAR in fact its geogebra

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

      Thanks! Was wondering the same thing.

    • @craway3119
      @craway3119 5 ปีที่แล้ว

      Geogebra

  • @roseywolf7867
    @roseywolf7867 3 ปีที่แล้ว

    It's just a theory A GAME MATH THEORY
    The Theorists: HECK YEAH!

  • @aryanmalhotra8081
    @aryanmalhotra8081 6 ปีที่แล้ว

    what software is it at 1:46 ?

  • @LordCPUU
    @LordCPUU 8 ปีที่แล้ว

    Hey would you please mind to tell me what software you are using to create those animations?`
    Very much appreciated!

  • @stop8576
    @stop8576 5 ปีที่แล้ว

    you are a legend thank you so much!!!!!

  • @PauloSamurai
    @PauloSamurai 3 ปีที่แล้ว

    Brilliant! Thanks

  • @cynthiadmello4132
    @cynthiadmello4132 8 ปีที่แล้ว

    can u please create a tutorial on... Like when the player in the game is inactive for a certain period... The next next process is highlighted(for example the finish point is highlighted) so that the player knows where he has to go..

  • @PinikRahman
    @PinikRahman 8 ปีที่แล้ว

    What software did you use to simulate the rotation on unit circle?

    • @PinikRahman
      @PinikRahman 8 ปีที่แล้ว

      Thanks mate..Ill look into it..

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

    how do you do a sine function in unity though

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

      private Vector3 _startPosition;
      void Start ()
      {
      _startPosition = transform.position;
      }
      void Update()
      {
      transform.position = _startPosition + new Vector3(Mathf.Sin(Time.time), 0.0f, 0.0f);
      }

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

    You are amazing, really :o

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

    But hey, that's just a theory. A GAME MATH THEORY. Thanks for watching.

    • @rafeeali1203
      @rafeeali1203 7 ปีที่แล้ว

      Beutiful=D sir I really appreciate you hahahha

  • @alexspeleers
    @alexspeleers 4 ปีที่แล้ว

    finaly I've understood HOW sin/cos func works. It's n*(X) where n = for(n=-3.14/n=0; n

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

    Thank you

  • @ruanncarlos3769
    @ruanncarlos3769 6 ปีที่แล้ว

    how did they create the function "sin (angle)" ?? I know I only need to use "Math.sin (f)", but I want to know how they created this function.

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

    I miss this guy😢

  • @lazandrei_19
    @lazandrei_19 8 ปีที่แล้ว

    what app did you use to showcase the sin wave?

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

    Yeah! so i can turn my homework to my teacher with unity project hahaha

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

    Thanks👍

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

    MatPat wannabe... lol keep up the good work man! I actually kinda enjoyed the GameTheory reference and I can see this series going places.

  • @davion_4623
    @davion_4623 8 ปีที่แล้ว

    just amazing

  • @Shdw-zu9ee
    @Shdw-zu9ee 8 ปีที่แล้ว

    I registered on the brakeys forum but when I want to create thread it says i eed to confirm my account :( but I got no confirmation email only 1 at the start but it was empty my name is Sh4d0w and I have the same profile pic

  • @floppy9053
    @floppy9053 6 ปีที่แล้ว

    Hey! Loved the video! I have a question. How Would I make waves one a 2D water thing, and A wave like splash at the point of impact when a rigid body hits it? Thanks, Some Guy You Don't Know That's subbed too you.

  • @linuxguy1199
    @linuxguy1199 8 ปีที่แล้ว

    will you do cosine and tangent

    • @somerandomnoob100
      @somerandomnoob100 8 ปีที่แล้ว

      A cosine graph is almost exactly the same as a sine graph and i cant imagine any use for a tan graph since its range is -infinity to +infinity

    • @linuxguy1199
      @linuxguy1199 8 ปีที่แล้ว

      Some Random Noob still i wanna knoow about them

    • @officialRandall
      @officialRandall 8 ปีที่แล้ว

      then grab a math book

    • @linuxguy1199
      @linuxguy1199 8 ปีที่แล้ว

      I AM LITERALLY TRIGGERED