Giter Site home page Giter Site logo

Comments (7)

ricardomatias avatar ricardomatias commented on May 27, 2024 2

This should definitely be configurable by a factor provided by the user. Is there any way of fixing this currently? It's quite unusable right now.

After further testing, this issue is only affecting tablets and not smartphones.

from camera-controls.

SrinivasPrabhu794 avatar SrinivasPrabhu794 commented on May 27, 2024 1

Hi @yomotsu

Any help on this will be appreciated!

from camera-controls.

yomotsu avatar yomotsu commented on May 27, 2024 1

sorry for the loooooong delay...
I checked the passed the delta value when internal zoom happens:

protected _zoomInternal = ( delta: number, x: number, y: number ): void => {

left is with a mouse wheel, and right is touch.
image

seems the value is not much different on both sides.
but mouse wheel events happened more frequently if my investigation is correct...

What we could do is that:
Accelerate the delta a little bit, If the internalZoom is called from touch events.
(but not sure...

if (
( this._state & ACTION.TOUCH_DOLLY ) === ACTION.TOUCH_DOLLY ||
( this._state & ACTION.TOUCH_ZOOM ) === ACTION.TOUCH_ZOOM ||
( this._state & ACTION.TOUCH_DOLLY_TRUCK ) === ACTION.TOUCH_DOLLY_TRUCK ||
( this._state & ACTION.TOUCH_ZOOM_TRUCK ) === ACTION.TOUCH_ZOOM_TRUCK ||
( this._state & ACTION.TOUCH_DOLLY_OFFSET ) === ACTION.TOUCH_DOLLY_OFFSET ||
( this._state & ACTION.TOUCH_ZOOM_OFFSET ) === ACTION.TOUCH_ZOOM_OFFSET ||
( this._state & ACTION.TOUCH_DOLLY_ROTATE ) === ACTION.TOUCH_DOLLY_ROTATE ||
( this._state & ACTION.TOUCH_ZOOM_ROTATE ) === ACTION.TOUCH_ZOOM_ROTATE
) {
const dx = _v2.x - this._activePointers[ 1 ].clientX;
const dy = _v2.y - this._activePointers[ 1 ].clientY;
const distance = Math.sqrt( dx * dx + dy * dy );
const dollyDelta = dollyStart.y - distance;
dollyStart.set( 0, distance );
const dollyX = this.dollyToCursor ? ( lastDragPosition.x - this._elementRect.x ) / this._elementRect.width * 2 - 1 : 0;
const dollyY = this.dollyToCursor ? ( lastDragPosition.y - this._elementRect.y ) / this._elementRect.height * - 2 + 1 : 0;
if (
( this._state & ACTION.TOUCH_DOLLY ) === ACTION.TOUCH_DOLLY ||
( this._state & ACTION.TOUCH_DOLLY_ROTATE ) === ACTION.TOUCH_DOLLY_ROTATE ||
( this._state & ACTION.TOUCH_DOLLY_TRUCK ) === ACTION.TOUCH_DOLLY_TRUCK ||
( this._state & ACTION.TOUCH_DOLLY_OFFSET ) === ACTION.TOUCH_DOLLY_OFFSET
) {
this._dollyInternal( dollyDelta * TOUCH_DOLLY_FACTOR, dollyX, dollyY );
this._isUserControllingDolly = true;
} else {
this._zoomInternal( dollyDelta * TOUCH_DOLLY_FACTOR, dollyX, dollyY );
this._isUserControllingZoom = true;
}

from camera-controls.

yomotsu avatar yomotsu commented on May 27, 2024

Thank you for your report.
The problem has been reproduced.

I will take a look, but sorry, I don't have much time at this moment. It may take some time.

from camera-controls.

SrinivasPrabhu794 avatar SrinivasPrabhu794 commented on May 27, 2024

Hi @yomotsu

I have been facing the same issue of zoom in ortho camera. Can you point me in a direction where I can take a look so that I can take a dig at this issue?

Regards
Srinivas

from camera-controls.

SrinivasPrabhu794 avatar SrinivasPrabhu794 commented on May 27, 2024

Thanks @yomotsu :) Sorry for my late reply, ill take a look based on your inputs :) I appreciate your help on this!

from camera-controls.

SrinivasPrabhu794 avatar SrinivasPrabhu794 commented on May 27, 2024

This helped me fix it for mobile devices. But the same pinch zoom slowness is observed when using the trackpad to pinch zoom on laptops in the orthographic mode. What solution would you suggest ?

from camera-controls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.