- Still trying to understand what the value in NFTs are from reading comments here - https://news.ycombinator.com/item?id=29265064
- Learning how to import 3D models into Three.js. It’s surprisingly easy! Even though there are a lot of 3D formats the industry standard is heading towards
gltf
which can either be a readable json format and/or a binary format.- there are are a few gltf variants:
- gltf
- glTF-Binary
- glTF-Draco
- glTF-Embedded
- there are are a few gltf variants:
- to import a gltf into three.js
import * as THREE from "three";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
//...
const gltfLoader = new GLTFLoader();
gltfLoader.load(
"/models/Duck/glTF/Duck.gltf",
(gltf) => {
console.log("success");
console.log(gltf);
scene.add(gltf.scene.children[0]);
},
(progress) => {
console.log("progress");
console.log(progress);
},
(error) => {
console.log("error");
console.log(error);
}
);
// ....
-
Note to import draco gltf you need to use the DRACOLoader
-
loads of free gltf to use here - https://github.com/KhronosGroup/glTF-Sample-Models
-
gltf can be created to have animations built into which can be activated using the
THREE.AnimationMixer
-
three.js 3d model tool - https://threejs.org/editor/