Consolidating MapControls, OrbitControls ans TrackballControls
See original GitHub issueContinuing the discussion from #18483.
The problem with that approach is that, if we did that, why not also consolidate all loaders into a single file too?
For usability reasons I think it’s better to keep this API:
import { MapControls } from './jsm/controls/MapControls.js';
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { TrackballControls } from './jsm/controls/TrackballControls.js';
So the proble to solve is how to make these files consolidate code without changing the API.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
OrbitControls – three.js docs
Orbit controls allow the camera to orbit around a target. ... Enable or disable horizontal and vertical rotation of the camera. Default is...
Read more >[Solved]-React and Three.js-three.js - appsloveworld.com
React Three Fiber: How to switch between TrackballControls and OrbitControls? ... How to export and then import a scene with Three JS? ......
Read more >How to limit panning distance in react three fiber MapControls
React Three Fiber: How to switch between TrackballControls and OrbitControls? 2 · Updating OrbitControls rotation when camera is rotated · 2.
Read more >Untitled
Built using three.js, OrbitControls and autosize JavaScript Updated on Oct 11, ... geometry merging, procedural terrains and shadow mapper research with ...
Read more >@react-three/drei - npm
Semi-OrbitControls with spring-physics, polar zoom and snap-back, for presentational purposes. These controls do not turn the camera but will ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is that
FirstPersonControls
may not reuse the code thatMapControls
,OrbitControls
andTrackballControls
aims to reuse.That is good point. I think we can easier implement such refactoring as soon as
exmaples/js
is gone. How about waiting with this issue until we git rid ofexmaples/js
? In this way, we can head for a cleaner solution by utilizing the ES6 module magic.In this case, it seems not appropriate to move
CameraControls
into the core. However, we might want to investigate if a genericControls
class could be developed which serves as a base class for all controls. A common interface/behavior for stuff likeconnect()
,disconnect()
,dispose()
and event handling might be interesting.