Issue with Orthographic camera?
See original GitHub issueHi!
I am using this piece of code to change the view from Perspective to Orthographic and back:
function toggleCamera() {
if (camera instanceof THREE.PerspectiveCamera) {
camera = new THREE.OrthographicCamera(window.innerWidth / -16, window.innerWidth / 16, window.innerHeight / 16, window.innerHeight / -16, -200, 500);
camera.position.set(0, 0, 500);
camera.name = 'Camera';
camera.up.set(0,0,1);
camera.lookAt(scene.position);
} else {
camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 5000);
camera.position.set(0, -1500/2, 1000/2);
camera.up.set(0,0,1);
camera.lookAt(scene.position);
camera.name = 'Camera';
}
// the orbit controls to rotate the camera
controls = new THREE.OrbitControls(camera, container);
controls.enableDamping = true;
controls.dampingFactor = 0.25;
controls.rotateSpeed = 1.0;
}
I obtain the following:
where one can see that the orthographic has lines all around.
Is that a bug or me misusing the API?
BR M
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Issue with orthographic camera · Issue #20314 · mrdoob/three.js
Keep in mind that when using OrbitControls with an orthographic camera, the zoom is no dolly. Meaning the camera does not move along...
Read more >Orthographic Camera Issue - Unity Forum
Orthographic camera setup in my game. Camera settings ... I think issue occurs while Clipping Planes - Near is set to negative number....
Read more >Orthographic view problems - camera position - Rhino
Hi I have to render some elevations, but everytime I load the view is always in a different position. I set the camera...
Read more >ThreeJS raycasting problem with an Orthographic camera in ...
Also, the near value of your orthographic camera is invalid. From the documentation: The valid range is between 0 and the current value...
Read more >problem with orthographic camera - LuxCoreRender Forums
problem with orthographic camera ... Hi, I've a simple scene: a box with open top, roughly a quarter of the top covered by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re using it right, it’s probably a problem with the shader math. I never thought of testing it with an OrthographicCamera, so definitely some things are different. I’ll check it out.
Is there a correlation between
lineWidth
for a perspective camera andlineWidth
for an orthographic camera?