Skip to content
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

Ortho camera support #46

Closed
wants to merge 3 commits into from
Closed

Conversation

Algorush
Copy link
Contributor

@Algorush Algorush commented Apr 1, 2024

made the first version for orthographic camera support with dummy perspective camera, for review.

@Algorush Algorush requested a review from Avnerus as a code owner April 1, 2024 02:17
@Avnerus
Copy link
Contributor

Avnerus commented Apr 1, 2024

Hi @Algorush!
Thank you for another contribution. I have some questions about this change:

  1. Can you describe your use-case of the orthographic camera?
  2. Why does 3D Tiles not work with an orthographic camera?
  3. Could this be resolved in three-loader-3dtiles instead? It sounds like it might be an issue with the loader and we could add support for orthographic cameras there, if needed.
  4. I took the opportunity now to refresh the CI and test suite. You can now test that a tileset load correctly with npm run test. The build should then pass the CI check.

@Algorush
Copy link
Contributor Author

Algorush commented Apr 1, 2024

  1. Can you describe your use-case of the orthographic camera?

Hi @Avnerus! We use Orthographic camera in 3DStreet Editor mode in two projections - for Plan View (view from above on the street), for Cross Section view (side view). You can see it here for example: https://3dstreet.app/#https://streetmix.net/kfarr/3/example-street

Why does 3D Tiles not work with an orthographic camera?

An error occurs when switching to the Orthographic camera related to the math.gl library:
image
I think this happens because the Ortho camera has different parameters from the Perspective camera, which three-loader-3dtiles uses, for example, it has no FOV. And camera Frustrum for ortho camera is calculated using another function.

Also, I'm sorry, this PR won't work with the standard version of Aframe-inspector for now. To be honest, I published this PR in this repo by mistake. I wanted to publish it in the 3Dstreet/aframe-loader-3dtiles-component repository. Because I applied a temporary solution here by adding the emit cameraChange event to the 3DStreet Editor code: 3DStreet/3dstreet-editor#410
Because as it turns out, the set-camera-active event no longer fires for some reason, here:

this.el.sceneEl.addEventListener('camera-set-active', (e) => {

Thank you very much for the suggestion to add Orthographic camera support to three-loader-3dtiles. I had already did it today, and it works good at first glance.
nytimes/three-loader-3dtiles#157

@Avnerus
Copy link
Contributor

Avnerus commented Apr 3, 2024

Thank you @Algorush!
Closing this for now and will comment in three-loader-3dtiles.

@Avnerus Avnerus closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants