I've been thinking about how to implement a portal, and after a quick search, everyone seems to do it by adding a camera per portal and then just update the other portal's view with that camera's view.
But if portals were real (like our real, the real in front of the monitor), they'd bend space in another dimension. Like the puzzle where you draw 5 points randomly on a sheet of paper and tell someone to connect those dots to all other dots without crossing lines (possible for 4 but not 5 dots). The trick to solving this puzzle is by bending the paper and poking through it at the right location (creating a "portal").
My question now is, can you implement the same technique in a game (engine) in 3D? Has someone done it before, and if yes, how does the math look like? Also, what would the pros and cons of doing it like this be? Is it more computational work to do? It sounds like it's just calculating with matrices, so doesn't sound that difficult for a GPU.
Please help me prevent another sleepless night, I've got stuff to do tomorrow. /s