www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: tinhtinhcd on August 04, 2017, 12:56:41 pm

Title: multi object in one sigle file.
Post by: tinhtinhcd on August 04, 2017, 12:56:41 pm
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.

Title: Re: multi object in one sigle file.
Post by: MichaelJPCT on August 05, 2017, 03:31:19 am
you can call setCenter or setRotationPivot on an Object3D
Title: Re: multi object in one sigle file.
Post by: tinhtinhcd on August 07, 2017, 04:55:51 am
but the are many object, which object should i call.
Title: Re: multi object in one sigle file.
Post by: EgonOlsen on August 07, 2017, 10:57:50 am
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.
Title: Re: multi object in one sigle file.
Post by: tinhtinhcd on August 08, 2017, 06:50:37 am
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.