jared-hughes / DesThree

Desmos bindings for three.js
4 stars 0 forks source link

Allow Drag Controls #11

Open jared-hughes opened 3 years ago

jared-hughes commented 3 years ago

It's annoying to control the view with a pair of sliders. Makes more sense to use something like OrbitControls to drag directly on the canvas.

Could be tricky to implement because view can also be controlled from PerspectiveCamera.

A few ideas:

  1. Use Desmos Regression to back-compute PerspectiveCamera arguments from the OrbitControls values. This is super complicated for little gain, and there could even be race conditions if view is controlled by a slider that is playing.
  2. Override PerspectiveCamera values with the OrbitControls values
  3. Use a function OrbitCamera that allows specifying fov, near, and far, avoiding the need for all this mess.