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

Thouchscreen zoom stucked OrthoPerspectiveCamera (ORTHO MODE) #531

Closed
5 tasks done
fedelaport opened this issue Nov 17, 2024 · 1 comment · Fixed by #558
Closed
5 tasks done

Thouchscreen zoom stucked OrthoPerspectiveCamera (ORTHO MODE) #531

fedelaport opened this issue Nov 17, 2024 · 1 comment · Fixed by #558
Labels
bug Something isn't working

Comments

@fedelaport
Copy link

fedelaport commented Nov 17, 2024

Describe the bug 📝

Hi guys,

we have a problem with the OrthoPerspectiveCamera. You can easily test this with any phone or tablet.

Open this: https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera
Put the scene camera projection to orthographic and just try to zoom (with a pinch to zoom touch gesture).

The zoom is not actually happening. If you keep doing it, it will simply front clip the model (like if the near plane is too close to the model).

It's like a problem when changing from perspective to ortho. Something else needs to be changed probably in setupOrthoCamera(). Seems like the controls are still doing the DOLLY that moves the camera towards the model.

We think this change is needed:

  private setupOrthoCamera(height: number, width: number) {
    this._component.controls.touches.two = CameraControls.ACTION.TOUCH_ZOOM_TRUCK;   // ADD THIS LINE
    this._component.controls.touches.three = CameraControls.ACTION.TOUCH_ZOOM_TRUCK;  // ADD THIS LINE
  }

Also this needs to be changed back in setPerspectiveCamera(), so:


  private async setPerspectiveCamera() {
    this._component.controls.touches.two = CameraControls.ACTION.TOUCH_DOLLY_TRUCK ;   // ADD THIS LINE
    this._component.controls.touches.three = CameraControls.ACTION.TOUCH_DOLLY_TRUCK ;  // ADD THIS LINE
  }

Reproduction ▶️

Open this: https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera

video_2024-11-17_21-40-30.mp4

Steps to reproduce 🔢

No response

System Info 💻

any mobile browser

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.
@fedelaport fedelaport added the bug Something isn't working label Nov 17, 2024
@fedelaport
Copy link
Author

fedelaport commented Nov 18, 2024

And to be honest, also this would be nice to be changed from the default. The default dollySpeed is 1.0, it is very slow for any bim model. We think 5 is better.

this._component.controls.dollySpeed = 5

GoulielmosFloros added a commit to GoulielmosFloros/engine_components that referenced this issue Feb 1, 2025
Fix the orthographic camera's zoom functionality on mobile devices that it was not working.

Added camera-controls package to enable extended actions to Orthographic camera. Added some functionalities to the camera when setting up the projection in the example.ts file.

Reviewed-by: Goulielmos
Refs: ThatOpen#531
HoyosJuan pushed a commit that referenced this issue Feb 16, 2025
* fix: mobile device orthographic camera zoom

Fix the orthographic camera's zoom functionality on mobile devices that it was not working.

Added camera-controls package to enable extended actions to Orthographic camera. Added some functionalities to the camera when setting up the projection in the example.ts file.

Reviewed-by: Goulielmos
Refs: #531

* fix: Fixed the issue in the libraries (projection.ts) instead of the example.ts file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant