I needed to switch the camera type in my three.js Demo, so I referred to an official demo at:
However, I encountered some errors when testing my demo. Pressing 'P' to use the cameraPerspective worked fine, but when I tried to switch to cameraOrtho using 'O', the camera control stopped functioning—I couldn't rotate or move my model sample.
Here is the code I used:
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>3D-earth</title>
<script src="JSandCSS/jquery-2.2.4.min.js"></script>
<script src="JSandCSS/three.min.js"></script>
<script src="JSandCSS/OrbitControls.js"></script>
<script src="JSandCSS/OBJLoader.js"></script>
<script type="text/javascript" src="JSandCSS/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="JSandCSS/qrcode.js"></script>
<script src="JSandCSS/bootstrap.min.js"></script>
<script type="text/javascript" src="JSandCSS/CanvasRenderer.js"></script>
<script src="JSandCSS/Projector.js"></script>
<link href="JSandCSS/bootstrap.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div style="width: 50%;">
<script>
// Code for initializing the scene, camera, and controls
</script>
</div>
</body>