Move GLTFLoader, OrbitControls, and BufferGeometryUtils to core
See original GitHub issueIs your feature request related to a problem? Please describe.
The GLTFLoader, OrbitControls, and BufferGeometryUtils are the three most imported things from the examples/jsm
(and the postprocessing-related things are the fourth, I think). I also think that they are stable enough to be moved to the core.
Describe the solution you’d like
I suggest they would be moved to the core.
Describe alternatives you’ve considered
They can remain in the examples and then users will still import them from examples/jsm
.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
OrbitControls – three.js docs
Orbit controls allow the camera to orbit around a target. To use this, as with all files in the /examples directory, you will...
Read more >Importing examples jsm modules causes bundlers to bundle ...
For example, when doing import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls' , the bundler will follow the import and ...
Read more >cannot use/import GLTFLoader and OrbitControls from threejs ...
I want to load a 3dModel with GLTFLoader but I cannot import it. Then I have tried to import OrbitControls and I got...
Read more >Adding OrbitControls to React Three Fiber - Code Workshop
Three.JS has an import we can use called OrbitControls that adds a lot of free camera movement functionality. It is very configurable and...
Read more >TransformControls with GLTF Animations - Three.js Tutorials
import * as THREE from 'three' import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls' import { GLTFLoader } from ...
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
I’m not sure I agree with this – isn’t it also confusing if some official loaders and controls come from one place, others from another? Why should switching from OrbitControls to MapControls change how you import the module?
It is a real source of confusion that we provide both
examples/js
andexamples/jsm
, and CDNs add another layer of complexity. I think Spotify’s concept of a golden path (“the opinionated and supported path to build something”) is a good thing, and we don’t really have that for our examples today. To me that is the underlying problem that leads people to want things moved into core, but I’m not sure it’s the right solution.Keeping the core build small also makes it easier to avoid gradually slipping into complicated interdependencies. For example, GLTFLoader’s spec/gloss materials are not (and shouldn’t be) core three.js materials.
The threshold for “three” vs. “three/examples/jsm/…” should probably not be stability or popularity, but:
Personally I don’t think these modules satisfy those two goals. They’re popular, but not foundational to other things. There are many ways to implement or customize controls, of which OrbitControls is the most popular but not the “best” in any objective way. There are at least two other glTF loaders for three.js, with their own pros/cons.
I could see components related to post-processing or node materials needing to be pulled into the core build at some point, for these reasons. Stability is necessary but not sufficient, and popularity is orthogonal.