Webgl scaling interaction can be improved

Currently you can only scale between large and small. I suggest changing code like this in order to scale smoothly in interaction.js. “_pmouseWheelDeltaY” may be removed.

const scaleFactor = 50;
  // ZOOM if there is a change in mouseWheelDelta
  if (this._mouseWheelDeltaY !=0) {
    // zoom according to direction of mouseWheelDeltaY rather than value
    if (this._mouseWheelDeltaY > 0) {
      this._renderer._curCamera._orbit(0, 0, sensitivityZ * scaleFactor);
    } else {
      this._renderer._curCamera._orbit(0, 0, -sensitivityZ * scaleFactor);
    }
    this._mouseWheelDeltaY =0;
  }

you probably want to hit up the github page

for info on how to contribute
https://p5js.org/contributor-docs/#/

and i believe the place to contribute

Thank you for your instructions, I’ve made a pull request.

1 Like