Graphics Reference
In-Depth Information
ting started with the WebGL renderer recipe we showed in Chapter 1 , Getting
Started :
function loadModel() {
var loader = new THREE.JSONLoader();
loader.load("../assets/models/
monkey.js", function(model, material) {
var mesh = new THREE.Mesh(model,
material[0]);
mesh.scale = new
THREE.Vector3(3,3,3);
scene.add(mesh);
});
}
The result is a rotating monkey, which we created in Blender, rendered by Three.js
as shown in the following screenshot:
See also
There are a few recipes that you will benefit from reading:
• In the Using OBJMTLLoader with multiple materials recipe, we use a different
format, which we load into Three.js
• In Chapter 7 , Animation and Physics , where we look at animations, we'll re-
visit the Three.js exporter plugin when we're working with skeleton-based an-
imations in the Animating with skeletons recipe.
Search WWH ::




Custom Search