yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

Home Page:https://yomotsu.github.io/camera-controls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Screen Space Panning

dntpannik opened this issue · comments

Is your feature request related to a problem? Please describe.

Hello,

I'm working on a drafting product and in this space the pan functionality doesn't actually move the camera in 3d space in a manner which would cause the perspective of the scene to change. It is more like the scene is a piece of paper on a desk and the pan operation is sliding the piece of paper relative to the camera.

I've attached a video showing the effect I'm going for.

ScreenSpacePan.mp4

I am unsure what this effect is called or even how to implement it. If you don't have the time or the interest to add this functionality if someone could maybe give me some ideas how to do it I can try to implement it myself.

Thank you.

Describe the solution you'd like

An additional parameter that allows me to enable/disable this feature. If enabled the pan operation would behave as I've described. If disabled it would behave as it currently does. Alternatively, a separate operation could be added such that both types of panning could be done, similar to zoom/dolly.

Describe alternatives you've considered

I'm unsure of any alternatives.

Additional context

No response

I think what you are looking for is offsetX and offsetY of PerspectiveCamera.prototype.setViewOffset()
see:

https://threejs.org/examples/?q=css#css3d_sandbox

Untitled.2.mp4