Math for Game Developers - Vector Reflections

Тәжірибелік нұсқаулар және стиль

How to calculate the reflection of a vector off a plane given the normal of the plane.
Intro to vectors: • MFGD - Intro to Vectors
Advanced vectors: • MFGD - Advanced Vectors
Intro to matrices: • MFGD - Intro to Matrices
Advanced matrices: • MFGD - Advanced Matrices
New video whenever I have time. Question? Leave a comment below, or ask me on Twitter: / vinobs

Пікірлер: 42

  • @LionUnchained
    @LionUnchainedАй бұрын

    This is my 3rd time coming back to this video, probably been somewhere north of 6 months since the first time... I just successfully calculated the reflect vector in my game. Once I inverted the vector and thought about it from the hit location it all made so much more sense.

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    Ай бұрын

    Hell yea brother!

  • @gmtfonseca
    @gmtfonseca8 жыл бұрын

    Just want to say that your classes are great, thanks for doing it! Cheers from Brazil!

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Gustavo Fonseca Thanks!

  • @SoulGuitarMetal
    @SoulGuitarMetal8 жыл бұрын

    Before I just pick up formulas and could not really understand it, use parts of it or build a more complex things. Now that I break down the process and drawing it on paper everything makes more sense. This video for example, is very clear why "v - 2vp" works. I can design and code some math based effects very easy now. Thank you very much for the channel!

  • @nameno7032
    @nameno70328 жыл бұрын

    Always awesome!

  • @mileswaugh
    @mileswaugh5 жыл бұрын

    This video is an absolute lifesaver!

  • @wattheshet
    @wattheshet8 жыл бұрын

    Cant thank you enough. Your channel help me alot of my math problems and my journey of game development.

  • @WindBendsSteel
    @WindBendsSteel5 жыл бұрын

    Thanks for that!

  • @MrSCA1991
    @MrSCA19915 жыл бұрын

    awesome stuff

  • @BudskiiHD
    @BudskiiHD8 жыл бұрын

    Just found your channel, great videos!

  • @TPS1001
    @TPS1001 Жыл бұрын

    Thank you so much! I needed this for a 3D basketball game I make with Scratch (for the ball-rim collision) :D

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    Жыл бұрын

    Glad I could help!

  • @isimbulamadmobenibulsun660
    @isimbulamadmobenibulsun6609 ай бұрын

    or what if we subtract, overlapped object's center point with impact point, normalize and then set object's direction with calculating normalized vector's reflection?

  • @jovanrakocevic8263
    @jovanrakocevic82636 жыл бұрын

    +Jorge Rodrigues I wanted to use this to achieve a mirror effect by reflecting front, up and right vectors (basically the rotation part of my view matrix) against the plane, and set the translation pretty much also reflected (so equally distant from plane but at the other side, as if the camera was in/behind the mirror) and render the scene from there, and then stick that rendered image onto the mirror per frame. Is this how it's done?

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    6 жыл бұрын

    That is all correct! Actually you can get by with it being a little simpler than that but for starters that does just fine.

  • @August0Moura
    @August0Moura8 жыл бұрын

    Your entire channel is very helpful, so much easy to understand, I learned a lot of stuff pretty fast with your videos, thank you :)

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Augusto Moura My pleasure! :)

  • @david137d7
    @david137d74 жыл бұрын

    Hi! do you have a code sample that works with finding a 3D reflected vector? Would love to see this work

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    4 жыл бұрын

    We didn’t use the dimension anywhere in this derivation. Should be the same code for any dimension of vector.

  • @adekadek1985
    @adekadek19858 жыл бұрын

    Hi Jorge! Great channel, great videos...very helpful, I have learned a lot. Thank you! Question: Are you planning to do some skeletal animation videos? That is very complex subject and I am sure it would be much easier to understand with your explanation. Cheers!

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Adrian Okarski I do have that on my list actually. I may take a while to get to it. Thanks!

  • @372leonard
    @372leonard8 жыл бұрын

    can you do ray sphere intersection?

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Paul Leonard Boon Naively you can do this by testing whether the length of the e vector from this video is less than the radius of the sphere: kzread.info/dash/bejne/iIiKk6mNotXacrQ.html I'll add to my list to see if something more elegant can be done.

  • @simonbenjamin1
    @simonbenjamin18 жыл бұрын

    Once again, brilliant work! I have 3D Primer for Graphics and Game Development and Essential Mathematics for Games and Interactive Applications. Great math books! Do you recommend any others?

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Simon Benjamin If you really want to learn this stuff, you could try a linear algebra textbook. Any textbook by Gilbert Strang is good.

  • @drink5863
    @drink58638 жыл бұрын

    hello Jorge Rodriguez I just found your videos and I thank you so much you made me realise how math and physics are the biggest parts of game development but I want to ask you do you learn this only in game design schools or in normal IT/programming schools because im not sure !

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    Much of it I taught myself. Later I went back to school for a math degree, but for the most part I produced these videos before I took the respective classes.

  • @drink5863

    @drink5863

    8 жыл бұрын

    Jorge Rodriguez can you learn this stuff only in a school about game development or can you learn this from a regular IT/programming school ?

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    Everything I teach in this channel can be learned at any public community college or university. Most of it will be available in programming-focused programs if you get a game programming degree from something like Full Sail or Digipen. If you go to a technical/IT school that focuses on programming, you may learn some of this stuff, but probably not. Either way, you can always learn any of this stuff from a book. If you want to be a game programmer and you're interested in an education, your local community college is the first place to look.

  • @372leonard
    @372leonard8 жыл бұрын

    ooooooooh forget the ray sphere intersection can you maybe do hierachical bounding volume tree's they look really hard to me but you've made hard stuff seem easy in the past

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Paul Leonard Boon I'll add it to my list :) A series on scene management would probably work pretty well.

  • @objectiveasylum
    @objectiveasylum8 жыл бұрын

    more people, especially in the video game industry had the conviction you had in just that one video

  • @jeffreydean7556
    @jeffreydean75568 жыл бұрын

    Trust me, you embarrassed yourself plenty.

  • @josephschmoe2448

    @josephschmoe2448

    8 жыл бұрын

    +Jeffrey Dean Yep. He actually proved the debunkers right, accidentally.

  • @ian.ambrose

    @ian.ambrose

    Жыл бұрын

    Sorry, what happened lol. Did he give wrong information of reflection concept or something? I just want to learn the stuff.

  • @NeoShameMan
    @NeoShameMan8 жыл бұрын

    no you didn't

  • @G3agle
    @G3agle8 жыл бұрын

    I don't think you did, people are putting up with gay parades and extreme feminists in real life and now we gotta deal with them in video games too? God help us all...

  • @drink5863

    @drink5863

    8 жыл бұрын

    what's wrong with you he isn't a feminist nor a homosexual you are trolling

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    8 жыл бұрын

    +Drin² K I am a feminist, actually. And yes, that guy will just have to put up with pride parades and extreme feminists in his video games.

  • @djmicrowave6073
    @djmicrowave6073 Жыл бұрын

    this really helped me alot!, just wanted to ask: would the vector reject of v and n (blue dotted line you drew) multiplied by 2 then subtracted from initial position give the final reflection position?

  • @JorgeVinoRodriguez

    @JorgeVinoRodriguez

    Жыл бұрын

    I think so yea

Келесі