multi object in one sigle file.

Started by tinhtinhcd, August 04, 2017, 12:56:41 PM

Previous topic - Next topic

tinhtinhcd

Hi,

I have an obj file with many object inside (about 67 object).
currently, when load from obj i made the fist object as parent and add the other as child to rotate and zoom.
the problem is when i set parent as center camera and rotate, it will rotate around the parent object, not the middle of them.
how can I rotate around the middle of them because I don't know which object is in the center of all object.


MichaelJPCT

you can call setCenter or setRotationPivot on an Object3D

tinhtinhcd

but the are many object, which object should i call.

EgonOlsen

Usually on the object that rotates. However, in your case, it might be a better solution to create a dummy object and place that at the desired rotation pivot. Then make all other objects children of that dummy object and rotate only that.

tinhtinhcd

Thanks EgonOlsen,

yesterday i saw the method megerAll(), i call this and treat all as one object, i see it work fine for me now.