Комментарии 2
Демка не работает
Автор оригинала не очень знаком с официальной докой
If three.js was installed from a CDN, use the same code, but with three/addons/ in the import map.
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@<version>/build/three.module.js",
"three/addons/": "https://unpkg.com/three@<version>/examples/jsm/"
}
}
</script>
<script type="module">
import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
const controls = new OrbitControls( camera, renderer.domElement );
</script>
Немного доработал для актуальной версии three.js
Зарегистрируйтесь на Хабре, чтобы оставить комментарий
3D-сердце на Three.js