Search code examples
javascriptjsonthree.jsmodels

Scaling a JSON model from Clara.IO with Three.js


I am new to Three.JS and have been practicing making scenes and models. I have loaded a Washing machine model into my scene and have managed to place it where I want. I am now trying to scale it (make it bigger) but I'm not sure how.

I currently have:

var objectLoader = new THREE.ObjectLoader();
objectLoader.load("models/machinethreejs/machine.json", function ( wm ) {

scene.add( wm );
wm.translateZ(275);
wm.translateX(150);
wm.translateY(55);

} );

Solution

  • three.js has a good documentation. Here there are all object/method in a Object3d : Object3D You can scale an object with the method object.scale.set(xScale, yScale, zScale)