www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: sushobhit on March 02, 2014, 02:44:52 pm

Title: Problem with Object3D.MergeObjects(first,second)
Post by: sushobhit on March 02, 2014, 02:44:52 pm
Hi Friends ,

Let me come straight to point...
I have a Plane , I have two Pyramids , and I have one more Object.
Now I merge these objects One by One into one single Object named EgyptObject using
Roughly :
EgyptObject = Object3D.MergeObjects(EgyptObject,Plane);
EgyptObject = Object3D.MergeObjects(EgyptObject,Pyramid1);
EgyptObject = Object3D.MergeObjects(EgyptObject,Pyramid2); 
EgyptObject = Object3D.MergeObjects(EgyptObject,OtherObject);

Now I have EgyptObject but problem is all Objects stay fixed to SimpleVector.Origin
When I try to translate before merging the translation is erased. And still objects stay fixed at origin.
What I want to to do is place the Objects on different places of the Plane and
a this on a Single Object (EgyptObject). Plz tell how to do it....

I will try to be more specific so as to make it easy to understand the issue :

Pyramid1.translate(0,0,50);   //// Even if I do translate before merge
EgyptObject = Object3D.MergeObjects(EgyptObject,Plane);  /////
EgyptObject = Object3D.MergeObjects(EgyptObject,Pyramid1);  ///// the object still gets fixed to the origin
EgyptObject = Object3D.MergeObjects(EgyptObject,Pyramid2); 
EgyptObject = Object3D.MergeObjects(EgyptObject,OtherObject);

SOS
Title: Re: Problem with Object3D.MergeObjects(first,second)
Post by: EgonOlsen on March 02, 2014, 03:49:56 pm
Merge merges objects in object space. If you want to apply a translation to object space, Have a look at translateMesh().
Title: Re: Problem with Object3D.MergeObjects(first,second)
Post by: sushobhit on March 03, 2014, 06:28:48 am
thanks egon sorry i didnt delete this post actually i got translatemesh using forum search as this issue was posted previously