Second test-project website with 3D animation Cube letter R, used lib THREE.js
Steps (terminal):
- npm init
- git init
- npm install three
Steps (starting):
- download for format .GLTFL the loader "GLTFLoader.js" from the list of different loaders: https://github.com/mrdoob/three.js/tree/dev/examples/jsm/loaders
- Working imports: importmap (index.html): <script type="importmap"> { "imports": { "three": "https://unpkg.com/[email protected]/build/three.module.js", "OrbitControls": "https://unpkg.com/[email protected]/examples/jsm/controls/OrbitControls.js", "GLTFLoader": "https://unpkg.com/[email protected]/examples/jsm/loaders/GLTFLoader.js", "RectAreaLightHelper": "https://unpkg.com/[email protected]/examples/jsm/helpers/RectAreaLightHelper.js", "RectAreaLightUniformsLib": "https://unpkg.com/[email protected]/examples/jsm/lights/RectAreaLightUniformsLib.js" } } </script>
import (main.js):
import * as THREE from 'three';
import { OrbitControls } from 'OrbitControls';
import { GLTFLoader } from 'GLTFLoader';
import { RectAreaLightHelper } from 'RectAreaLightHelper'
import { RectAreaLightUniformsLib } from 'RectAreaLightUniformsLib';
Other Sources: