You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
#### JavaScript 3D library
10
10
11
-
The aim of the project is to create an easy to use, lightweight, cross-browser, general purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available in the examples.
11
+
The aim of the project is to create an easy to use, lightweight, cross-browser, general purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available as addons.
Copy file name to clipboardExpand all lines: docs/manual/en/introduction/Installation.html
+20-9Lines changed: 20 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ <h2>Install from CDN or static hosting</h2>
64
64
65
65
<p>
66
66
The three.js library can be used without any build system, either by uploading files to your own web server or by using an existing CDN. Because the library relies on ES modules, any script that references it must use <em>type="module"</em> as shown below.
67
-
It is also required to define an Import Map which resolves the bare module specifier `three`.
67
+
It is also required to define an import map which resolves the bare module specifier `three`.
68
68
</p>
69
69
70
70
<code>
@@ -88,42 +88,53 @@ <h2>Install from CDN or static hosting</h2>
88
88
</code>
89
89
90
90
<p>
91
-
Since Import maps are not yet supported by all browsers, it is necessary to add the polyfill *es-module-shims.js*.
91
+
Since import maps are not yet supported by all browsers, it is necessary to add the polyfill *es-module-shims.js*.
92
92
</p>
93
93
94
-
<h2>Examples</h2>
94
+
<h2>Addons</h2>
95
95
96
96
<p>
97
-
The core of three.js is focused on the most important components of a 3D engine. Many other useful components — such as controls, loaders, and post-processing effects — are part of the [link:https://github.com/mrdoob/three.js/tree/dev/examples/jsm examples/jsm] directory. They are referred to as "examples," because while you can use them off the shelf, they're also meant to be remixed and customized. These components are always kept in sync with the core library, whereas similar third-party packages on npm are maintained by different people and may not be up to date.
97
+
The core of three.js is focused on the most important components of a 3D engine. Many other useful components — such as controls, loaders, and post-processing effects — are part of the [link:https://github.com/mrdoob/three.js/tree/dev/examples/jsm examples/jsm] directory. They are referred to as "addons" (previously called "examples"), because while you can use them off the shelf, they're also meant to be remixed and customized. These components are always kept in sync with the core library, whereas similar third-party packages on npm are maintained by different people and may not be up to date.
98
98
</p>
99
99
100
100
<p>
101
-
Examples do not need to be <em>installed</em> separately, but do need to be <em>imported</em> separately. If three.js was installed with npm, you can load the [page:OrbitControls] component with:
101
+
Addons do not need to be <em>installed</em> separately, but do need to be <em>imported</em> separately. If three.js was installed with npm, you can load the [page:OrbitControls] component with:
102
102
</p>
103
103
104
-
105
104
<code>
106
105
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
107
106
108
107
const controls = new OrbitControls( camera, renderer.domElement );
109
108
</code>
110
109
111
110
<p>
112
-
If three.js was installed from a CDN, use the same CDN to install other components:
111
+
If three.js was installed from a CDN, use the same code, but with `three/addons/` in the import map.
import { OrbitControls } from 'https://unpkg.com/three@<version>/examples/jsm/controls/OrbitControls.js';
128
+
import * as THREE from 'three';
129
+
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
119
130
120
131
const controls = new OrbitControls( camera, renderer.domElement );
121
132
122
133
</script>
123
134
</code>
124
135
125
136
<p>
126
-
It's important that all files use the same version. Do not import different examples from different versions, or use examples from a different version than the three.js library itself.
137
+
It's important that all files use the same version. Do not import different addons from different versions, or use addons from a different version than the three.js library itself.
0 commit comments