What this portal demo still lacks is:
An algorithm to find a good position for a portal. As you can see when it fails to fit the portal in a surface (more or less) it fails.
It orients the portals as the player looks at the surface, adding a roll in some surfaces, that I remove after crossing the portal.
It doesn't respect up-down rotation due to the character rotation being different depending on the controller / main rotation.
What it does:
I'm using clipping planes to allow the view cam to move backwards so that you don't see the surface where the portal is positioned
Vector algebra to keep the velocity and orientation / rotation of the character controller. A mirror of the relative position of the character to the portal related to the sibiling portal's camera.
Checking with raytracing if the portal fits or not on a surface.
Simple noise effect to the portal borders. Not really fancy but enough for the demo.
I will update this version as soon as I have more time.