Как стать автором
Обновить

Комментарии 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>

Зарегистрируйтесь на Хабре, чтобы оставить комментарий