I am trying to make a perspective camera go through a portal like in the game Portal, and rotate relative to the portal face it comes out of so you are facing the same way the exit portal is facing while keeping the same viewpoint you had when entering a portal. I have tried to implement this using getWorldDirection() like so:
var portalNormal = new THREE.Vector3();
portal.getWorldDirection(portalNormal);
var exitPortalNormal = new THREE.Vector3();
exitPortal.getWorldDirection(exitPortalNormal );
var camNormal = new THREE.Vector3();
camera.getWorldDirection(camNormal);
camNormal.add(portalNormal);
camNormal.sub(portalLinkNormal);
camera.lookAt(camNormal)
This code seems to almost work, but the camera never rotates quite right. Thanks for the help! And also let me know if I'm asking the right question because I'm not sure quite how to word it.