What is required to convert threejs perspective camera to orthographic

I have code that converts a perspective camera to an orthographic camera. The problem is when i convert them the model become very tiny and hard to see.

I have calculated the zoom factor for the orthographic camera based on the distance and FOV. Are there any other properties i need to set on the orthographic camera. i.e clipping plane, etc… i believe the position remains the same. I’m not sure what else i need to calculate.

if (cameraType === "Perspective") {
  //calculate  zoom Factor by calculating distance of object from camera and perspective cameras FOV
  //create threejs orthographic camera
  // set camera on scene --- my model is shifted very far and becomes hard to see
}

I also tried setting the same camera properties i.e clipping planes etc of the perspective for the orthographic and i still had the same problem. I guess i am missing some property or calculation required to put the object in the same position as it was when it is in perspective camera view.

It would help if you shared your code. Also have a look at
https://threejs.org/examples/#webgl_camera

You can check out how CombinedCamera solved this problem:

2 Likes