Struggling to toggle between Perspective and Orthographic cameras in my script. I need objects at certain depths to maintain their projection size. I've reached a point of confusion when trying to understand the geometry...
Can anyone recommend a simple tutorial? This one seems too complex for me.
For objects with position.z==0
, I currently have:
perspCamera = new THREE.PerspectiveCamera(45, W / H, 1, 1000);
perspCamera.position.z = 100;
var S=Math.tan((45/180)*Math.PI)*100;
orthoCamera = new THREE.OrthographicCamera( -S, S, S, -S, 1, 1000 );
This setup is incorrect.
Update:
I finally figured it out and will share my solution with a codepen link.