Skip to content

Ortho camera support - #46

Closed
Algorush wants to merge 3 commits into
nytimes:devfrom
3DStreet:ortho-camera-support
Closed

Ortho camera support#46
Algorush wants to merge 3 commits into
nytimes:devfrom
3DStreet:ortho-camera-support

Conversation

@Algorush

@Algorush Algorush commented Apr 1, 2024

Copy link
Copy Markdown
Contributor

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

Avnerus commented Apr 1, 2024

Copy link
Copy Markdown
Contributor

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

Algorush commented Apr 1, 2024

Copy link
Copy Markdown
Contributor Author
  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

Avnerus commented Apr 3, 2024

Copy link
Copy Markdown
Contributor

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