Skip to main content

Search

make Portals and Lasers behave

  • TAPgiles
    Great answers

    It's a bit of a complex topic, and required maths to figure out from the direction of the laser, combined with the direction of the portal, convert it using the direction of the other portal, to get a new direction for the laser on the other side. It's doable, but you have to make the maths for it. So you can Google that to learn about how that works.

    Here's one video I found helpful to learn what dot products are and how to calculate them--which is used to turn global directions etc. into local ones and back again basically. So that'll be a big part of it. https://youtu.be/MOYiVLEnhrw?t=8781

    I also have a "daydream" article on patreon, which explains how to display a laser bouncing off of a surface. The maths will be roughly the same, but expanded to take the second portal into account. https://www.patreon.com/posts/laser-reflection-53063121

Please sign in to leave a comment.