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

Controls for changing default target position that the camera orbits around

kitaedesigns opened this issue · comments

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

The camera's orbit target seems to default to a certain location in front of the camera but this variable seems inaccessible as it is buried in CameraControls.ts if I am not mistaken.

Describe the solution you'd like

It would be useful to expose this publicly to make navigation of the camera easier and more flexible for different scenarios, i.e. switching between first-person vs third-person, vs object in scene to orbit around etc.

Describe alternatives you've considered

No response

Additional context

No response

I mean specifically for the default camera target settings like in keyboard.html where the orbit target is some arbitrary unit in front of the camera. I assume I would have to change this somewhere in CameraControls.ts to relocate the default orbit point?
https://yomotsu.github.io/camera-controls/examples/keyboard.html

Sorry for the delay, and I still don't get the point of "target".
as explained here, the orbit revolves around the target.
If you wish to change "arbitrary unit", you can change the distance of the camera to the target with .distance or .dollyTo( distance ).

So if I wanted to make the camera act like a First-Person camera where it rotates from its POV, I would just change .distance to 0? I'm essentially trying to make the keyboard.html example be like a First-Person navigation game

That's right. however, .distance can't be 0 or a negative number. Use a small number like 0.0001 instead.