Math for Game Devs [2022, part 3] • Matrix4x4 & Cross Product

Поділитися
Вставка
  • Опубліковано 25 жов 2022
  • Primarily for my students at FutureGames - I will only read chat/superchats during breaks!
    Assignments here!! ❱ acegikmo.notion.site/Lectures...
    Find out more about the school at futuregames.se/
    ❓ FAQ ❱ acegikmo.notion.site/FAQ-8b62...
    💖 Support me on Patreon ❱ / acegikmo
    📺 I usually stream on twitch ❱ / acegikmo
    💬 Join my discord ❱ / discord
    🐦 Follow me on twitter ❱ / freyaholmer

КОМЕНТАРІ • 56

  • @sparlott1347
    @sparlott1347 Рік тому +91

    Lecture starts here: 5:21

  • @cosmicg_oth
    @cosmicg_oth 5 місяців тому +20

    5:21 Matrices
    56:00 Matrix Inversion
    59:10 Last Row of the Matrix4x4
    1:03:10 Break/Questions
    1:36:09 Shows off game/Use cases for Dot product & Matrix transformation
    1:44:25 Coordinates
    1:48:47 Cross product
    2:02:20 Break
    2:10:30 Cross product use case
    (Will add the rest when I finish the video)

    • @Zarial_
      @Zarial_ Місяць тому +2

      Did you finished ? 👀

  • @soupmachine5831
    @soupmachine5831 Рік тому +6

    Blessed be the queen of programing, my here shining light touch all our source codes.

  • @PaulKingIII
    @PaulKingIII 10 місяців тому +1

    I fell asleep and I woke up and this was playing

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

    Thanks for sharing this

  • @IrocZIV
    @IrocZIV Рік тому +2

    Thanks

  • @Ludrien
    @Ludrien Рік тому +12

    Really high quality content. Love your lectures!

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

    That game looks similar to Data Wing. Love that one. Great video, I learnt a lot.

  • @itsm0saan
    @itsm0saan Рік тому +3

    Hey, I would like to say thank you^^

  • @Horoprime
    @Horoprime 8 місяців тому +4

    It's really hard to navigate without chapters/timecodes, could you please add them?
    Overall it's a great course, thank you very much!

  • @xhivo97
    @xhivo97 9 місяців тому

    Love how unread engine is on its own on the coordinate system chart 😂 (to be fair it's the most intuitive for me too, since probably im guessing xy on 2d and xy on 3d games is the same)

  • @vima9046
    @vima9046 Рік тому +2

    At minute 52:12 the explanation is a little bit confusing because i think if we want to do what you are explaning (find a relative direction from us) we should use "InverseTransformDirection" instead and not TranformDirection. Using TransformDirection would be true only if the object that is calling TranformDirection is not rotated.

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

      there was a typo; it should have been M^-1*(v.y, v.x, v.z, 1), you should be able to replicate it by calling transform.TransformDirection()^-1, the inverse of a function could be represented as if f(y) = x, then putting y in the inverse of f should give you x. the previous section where she explained how multiplying a 4x3 matrix by a 1x4 matrix would give you local to world ,multiplying the by the inverse of the 4x3 matrix should give you world to local

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

    do transformation matrices need to have orthogonal basis vectors? that is, do the basis vectors of local space have to be orthogonal for our local-to-world transformation?

  • @blackpanda1302
    @blackpanda1302 Рік тому +2

    ❤️❤️thx

  • @SuthernHunter
    @SuthernHunter 9 місяців тому +3

    Does anyone know where you can buy those 3D axis models she showed? Having a physical thing I can use as reference always helps and I can't draw 3D space to save my life.

    • @NOT_A_ROBOT
      @NOT_A_ROBOT 9 місяців тому

      you can probably just make one yourself with some toothpicks, glue, and paint for color

  • @francoperez4593
    @francoperez4593 Місяць тому +1

    49:00
    1:26:30
    1:40:50
    1:44:50
    1:53:30

  • @MertowVA
    @MertowVA Рік тому +7

    Even though I know my matrices it's nice to see the way you implement code. These are great!

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

    Another remarkable representation of life and the world we live in. The more knowledge we accumulate the greater our abilities become to go on and do great things.

  • @OmarAlmokhtar0
    @OmarAlmokhtar0 7 місяців тому

    should I have fluency in unity to solve the assignments ?

  • @vima9046
    @vima9046 Рік тому +1

    Hello Freya! There is one thing that i don't understand. Maybe it's just because i don't have much experience with this stuff. My question is in the exemple as the minute 49:30 why should we calculate the offset in local space using the appropriate functions and than find the position in world space instead doing everything in global coordinates? (In short i don't undesrand if is necessary switching from local to global system). Thanks in advance!

    • @samuelmorey9097
      @samuelmorey9097 Рік тому +1

      Hey Vincnet. In general it can be easier to reason through, and the math can be simpler, and better visualized when working in the local space coords. if you get a world space vector, you might have to do some Vector addition to get it in the proper spot. If you are just using local space coords, you know it will be in the correct spot without much thinking. Either way is valid, I think working in local space is just less mental overhead.

    • @acegikmo
      @acegikmo  Рік тому +2

      yep! I think I talk about this extensively during some of the assignment solution videos

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

      @@samuelmorey9097 Thanks a lot for the reply! Yes, watching the assignment solution video i just realized how can be helpful :)

  • @matthewpublikum3114
    @matthewpublikum3114 Рік тому +2

    So, vector V's point of origin is P, and using the coordinate space of vectors x,y,z?

  • @vima9046
    @vima9046 Рік тому +1

    I tried to set the trasform.position of an gameobject equal to a vector4 (2,2,2,0) believing that the value of "w" set to 0 would not change the position of the object but only rotate it. Instead the object got the position of 2,2,2 in the global world. Was it me who misunderstood that "w" set to zero would just rotate the object or is there something strange?

    • @acegikmo
      @acegikmo  Рік тому +3

      transform.position only uses a Vector3, the w component is only used when you're using matrices directly, like transform.localToWorldMatrix

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

      @@acegikmo Thanks for clarifying me! ♥️

  • @Oryxide
    @Oryxide 7 місяців тому

    Do the contents of a rotation matrix change depending on if Y is up instead of Z?

    • @cptwoody7103
      @cptwoody7103 Місяць тому

      somehow unity using left hand rule with Y is up . speaking of transform rotation matrix itself, orientation will depend on where each basis vector land so yes it depend on which current basis vector goes

  • @pazalla
    @pazalla Рік тому +1

    Hi @Acegikmo,
    I have a problem at 2:33 (ua-cam.com/video/gVgN5SU6BrA/v-deo.html) because when I draw the normal it is wrong. I fixed it changing this line of code:
    Gizmos.DrawLine(raycastHit.point, raycastHit.normal); =>
    Gizmos.DrawLine(raycastHit.point, raycastHit.point + raycastHit.normal);
    Maybe I miss any setting?
    Thanks and best!
    You are doing a fantastic job!

    • @nikent8517
      @nikent8517 Рік тому +1

      Gizmos.DrawLine's second parameter works in world space, so when you put normal's vector in there, it will project this vector from world space, not from hit space
      It also would work if you used Gizmos.DrawRay, because it's second parameter project needed vector from first parameter position

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

    I think unity it's not the best tool to explain and create real case scenarios. You should code outside game engines weather using opengl or directx api.

  • @user-sq3sb7qn3m
    @user-sq3sb7qn3m 6 місяців тому

    blud i fell asleep w my pc on and this came on

  • @isilozcelik
    @isilozcelik Рік тому +1

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

    Didn't understand a single thing, but after watching this for three hours I was able to shoot one more baddie than usual in Halo 2.

  • @mathbbn2676
    @mathbbn2676 9 місяців тому

    💝💝💝💝

  • @metehanerkol2837
    @metehanerkol2837 Рік тому +1

  • @maju-mu7rr
    @maju-mu7rr 8 місяців тому

    wowo

  • @VladimirIshenko
    @VladimirIshenko 11 місяців тому +7

    Lol, people paying 40$ for broken games, while you hiding so satisfying thing on your hard drive. Shame! Push it immediately!

  • @tisalee04
    @tisalee04 9 місяців тому

    uyuhuhuhu

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

    Banana

  • @Aleteos
    @Aleteos Рік тому +3

    I... am so confused. I thought for sure you had made a mistake using column vectors in your 4x4 matrix instead of row vectors, so I tried making a modification in my own code to test it.
    I'm implementing a ladder in GZDoom's ACS script, so there's no built in matrices, not even 2d or 3d-vectors. It's all per element multiplication of arrays. Fun times!
    I want to transform the players position in world space to ladder space, as defined by a line(doom maps are drawn as top-down 2d) and I thought I had it all figured out after the last lecture "yesterday"(part 2).
    I got the delta subtracting a point on the middle of the line from the player's global coordinates, then
    I assign the ladder space x coordinate by multiplying the x-component of the ladder's right vector with the delta's x-component and add to that the product of the y-component of the ladder's right vector and the delta's y-component.
    (then basically the same for the y-component)
    But doing it like you're suggesting in this video, I should multiply the x-component of the ladder's right vector with the delta's x-component, then add to that the product of the x-component of the ladder's out vector and the delta's y-component...
    and it works.
    In fact, I get the exact same results.
    I don't even know how that makes sense.
    This should suggest that instead of scalar projection against each basis vector in turn, one could dot with the x-components(then y-components) of both basis vectors, and arrive at the same result?
    My brain is broken now.
    ...wait, of course they're the same
    I literally made them the same value
    ladderRight is [cos(ladderAngle), sin(ladderAngle)] and
    ladderOut is [sin(ladderAngle), -cos(ladderAngle)]
    I've literally just flipped the "matrix" around the diagonal, haven't it...

  • @brothertyler
    @brothertyler 9 місяців тому

    I could tell that you were a man from your thumbnail icon, and did not even need to hear your masculine voice.
    It's not too late to make the return journey.