Three.js
- Download three.js from three.js website.
-
Follow the Getting Started tutorial. We’ll go over this together.
-
Import an external model into your project:
Save the file from here into a file called OBJMTLLoader.js
, within your three.js folder.
Include this code to import an OBJ with materials:
var objMtlLoader = new THREE.OBJMTLLoader(); // create the OBJ loader
objMtlLoader.load("filename.obj", "filename.mtl", function(object, url) { // load the OBJ and companion MTL
scene.add(object); // add it to the scene
});