Many examples use a negative value for OrthographicCamera.near

I’ve just taken a quick look through the examples, and there are a lot of places where the orthographic camera has a negative near value, including CinematicCamera.js, transition.js, misc_exporter_gltf and webgl_postprocessing_advanced.

It’s my understanding that the valid values for camera near and far are:

PerspectiveCamera: Infinity > far > near > 0
OrthographicCamera Camera: Infinity > far > near >= 0

It seems to me that this is confusing even for the “experts” who wrote these examples. Since setting camera parameters is unlikely to be a hot code path, perhaps we should consider adding a warning when invalid parameters are set here?

We should also correct all the examples that use negative values here.

Author: Fantashit

1 thought on “Many examples use a negative value for OrthographicCamera.near

Comments are closed.