File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -92,18 +92,15 @@ <h2>Loading</h2>
9292 // commonjs
9393 var THREE = window.THREE = require('three');
9494 require('three/examples/js/loaders/GLTFLoader');
95- </ code >
9695
97- < p >
98- Currently three.js examples are not available as ES modules (import … from '…').
99- Several workarounds are discussed in
100- < a href ="https://github.com/mrdoob/three.js/issues/9562 " target ="_blank " rel ="noopener "> #9562</ a > .
101- </ p >
96+ // ES modules
97+ import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
98+ </ code >
10299
103100 < p >
104101 Once you've imported a loader, you're ready to add a model to your scene. Syntax varies among
105102 different loaders — when using another format, check the examples and documentation for that
106- loader. For glTF, basic usage would be:
103+ loader. For glTF, usage with global scripts would be:
107104 </ p >
108105
109106 < code >
Original file line number Diff line number Diff line change @@ -79,13 +79,10 @@ <h2>加载</h2>
7979 // commonjs
8080 var THREE = window.THREE = require('three');
8181 require('three/examples/js/loaders/GLTFLoader');
82- </ code >
8382
84- < p >
85- 目前three.js示例不能作为ES modules (import … from '…')来使用。
86- 这里讨论了一些解决方法:
87- < a href ="https://github.com/mrdoob/three.js/issues/9562 " target ="_blank " rel ="noopener "> #9562</ a > .
88- </ p >
83+ // ES modules
84+ import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
85+ </ code >
8986
9087 < p >
9188 一旦你引入了一个加载器,你就已经准备好为场景添加模型了。不同加载器之间可能具有不同的语法 ——
You can’t perform that action at this time.
0 commit comments