CADmium-Co / CADmium

A CAD program that runs in the browser
https://cadmium-co.github.io/CADmium/
Other
1.35k stars 51 forks source link

Pan speed is too fast #72

Open MattFerraro opened 1 month ago

MattFerraro commented 1 month ago

On my macbook, on both Chrome and Firefox, on both a retina screen and a standard DPI screen, the pan functionality of the camera controller is too fast. The screen moves faster than the mouse does.

Strangely, on the retina screen it is only a little bit too fast. On the standard screen it moves much faster.

Expected behavior is a "natural" pan where the scene tracks the mouse cursor exactly no matter the browser or screen density.

sebsebmc commented 1 week ago

Is the expectation that the scene origin is what pans across the screen an equivalent amount to what the mouse moves in screen space? I believe other 3D interfaces usually allow dropping an anchor that represents the point in the scene that is referenced when panning or rotating about.

MattFerraro commented 1 week ago

yeah, the expectation I have is that when I click the mouse to pan and then move it 100 pixels to the left, every single pixel on the screen moves 100 pixels to the left and a new 100 pixels worth of scene content appears on the right. Note that this effect is only possible with an Orthographic camera, but that's the kind we use. When we want to support a Perspective camera someday we'll have to work out which one depth into the Scene has that property, which we'd probably resolve with the anchor approach as you described!