Author Topic: about Object3D[],why load3DS is ok,but loadSerializedObjectArray is wrong?  (Read 2010 times)

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
i have two files,a.ser,a1.3ds.
there are the same thing just different format,this is the big model which contains many parts.i want every part of it is the single objetc3D
in jpct.here is the code:

which is ok:

Object3D[] waypoint= Loader.load3DS(res.openRawResource(r.raw.a1), 1);   
           
 world.addObject(waypoint[1]);




which is wrong:
Object3D[] waypoint= Loader.loadSerializedObjectArray(res.openRawResource(r.raw.a));   
world.addObject(waypoint[1]);





ps:the model have 100 parts,use load3ds everything is ok.
use loadSerializedObjectArray,just world.addObject(waypoint[0]) is ok,and show 100 parts.
i think,in loadSerializedObjectArray all of parts is saved in waypoint[0] not waypoint[].
How can i fix it?
thx,ego.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: about Object3D[],why load3DS is ok,but loadSerializedObjectArray is wrong?
« Reply #1 on: September 24, 2014, 09:00:50 pm »
So, basically what is at index 1 in the "normal" loaded object array can be found at index 0 in the deserialized one? I don't see how this is supposed to happen nor have i ever experienced anything like it. Are you sure that your serialization code doesn't cause this somehow?

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: about Object3D[],why load3DS is ok,but loadSerializedObjectArray is wrong?
« Reply #2 on: September 25, 2014, 04:24:46 am »
i translate 3ds to ser just with jbrush,every single model(3ds,md2,obj)  translate into ser with jbrush, is ok,but object3D array is my first time with jbrush.
maybe the problem is the jbrush?

I think jbrush's  ser method is the same thing with jpct_desktop's ser method.
may be i am wrong?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: about Object3D[],why load3DS is ok,but loadSerializedObjectArray is wrong?
« Reply #3 on: September 25, 2014, 08:22:05 am »
it should be the same method, but maybe it's doing something else in addition that causes this. Have you tried to serialize the model by using normal Java code instead of jBrush?