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?
Asked
Active
Viewed 901 times
0
-
Something like that: `var size = new THREE.Box3().setFromObject( _your_obj_ ).getSize();`. But it's better to provide more information in the question. – prisoner849 Feb 20 '18 at 09:44
-
Width and height are relative, you cant find it easy. – pailhead Feb 20 '18 at 21:19
1 Answers
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