-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLTFExporter: fix znear and zfar range for cameras #13396
Conversation
Thanks! |
In Three.js, near and far should be PerspectiveCamera: Infinity > far > near > 0 https://threejs.org/docs/#api/cameras/OrthographicCamera.near So ideally we don't need to check in exporter. I think this check should be done in loader, rather than in exporter. @fernandojsg How did you make/load the model which didn't pass the validation? I suppose there's another root issue. |
/ping @fernandojsg |
@takahirox even if the valid ranges are as you stated, three.js doesn't have any type of validation when you set these values so it's perfectly fine to add a <0 near plane and things will works as expected. In fact if you look at the examples where the ortho camera is being used, you could find many examples where it has a negative value. |
I discussed with @mrdoob on Twitter. https://twitter.com/superhoge/status/966966096141193216 We concluded it's worth to ensure the valid values in
I wanna add note about it in From these reasons, feeling like we should more aggressively ensure the valid values in the exporter. |
BTW
I think we should fix the examples (or update the documents). |
To pass validation
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#orthographiczfar-white_check_mark
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#orthographicznear-white_check_mark
#13380