www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: apaladin@naver.com on September 20, 2012, 04:01:09 am

Title: loadSerializedObject question
Post by: apaladin@naver.com on September 20, 2012, 04:01:09 am
Hi every one

i have a model 3ds file . it has a 0~7 part's.
eg. obj_0.res ~obj_7.res

cause i coded like this.

Object3D model = Loader.loadSerializedObject(res.openRawResource(R.raw.obj_0));
            
for(int i = R.raw.obj_0; i < R.raw.obj_7; i++){
 if(i == R.raw.obj_0)continue;
 Object3D _tmp = Loader.loadSerializedObject(res.openRawResource(i));
 _tmp.strip();
 _tmp.setVisibility(Object3D.OBJ_VISIBLE);
 _tmp.setAdditionalColor(RGBColor.RED);
 model.addChild(_tmp);
}

but dosen't seeing whole object.
just seeing "obj_0" first loaded "model" variable.

Question is 3dObject has Multiple part's. how can load it?
Just anybody little hint  for me ?
Title: Re: loadSerializedObject question
Post by: Thomas. on September 20, 2012, 09:13:07 am
If you have more than one part in one file, you have to use loadSerializedObjectArray(InputStream is) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObjectArray(java.io.InputStream)) method