ethanpisani.com/threejs-test/example.js
2021-04-09 14:05:27 -04:00

18 lines
713 B
JavaScript

import * as THREE from 'https://threejsfundamentals.org/threejs/resources/threejs/r125/build/three.module.js';
import {OrbitControls} from 'https://threejsfundamentals.org/threejs/resources/threejs/r125/examples/jsm/controls/OrbitControls.js';
import {GLTFLoader} from 'https://threejsfundamentals.org/threejs/resources/threejs/r125/examples/jsm/loaders/GLTFLoader.js';
const loader = new GLTFLoader();
const scene = new THREE.Scene();
//scene.background = new THREE.Color('black');
// Load a glTF resource
const gltfLoader = new GLTFLoader();
gltfLoader.load('../models/organic/propan-2-ol.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root);
gltf.asset;
render();
});