0

I am the beginner in Three.js. I import three.js .obj file using the visible 3D object. How to find this .obj object original width and height?

1 Answers1

0

To make all objects of same size just after import do this,

var box = new THREE.Box3().setFromObject(object);
let radius = box.getBoundingSphere().radius;
let scale = 200/radius;
object.scale.multiplyScalar(scale);
Amritesh Anand
  • 893
  • 11
  • 22
  • Thank you, How to modify the .obj width and height. I tried `object.scale.set(width,height,width)` but object visible enlarge size. How to modified .`obj` object size @answered –  Feb 20 '18 at 14:34
  • You have to calculate width height with respect of object distance from camera. – Amritesh Anand Feb 23 '18 at 19:45