www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: zoalord12 on November 19, 2015, 02:40:03 am

Title: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: zoalord12 on November 19, 2015, 02:40:03 am
Hi

Im serializing stuff on windows and reading it on Android

I serialized in  JPCT 1.15Beta3
I deserialzie in JPCT-AE 1.0 , there is a version mismatch and it wont deserialize Object3D

it throws the exception
java.lang.RuntimeException: [ 1447896135952 ] - ERROR: Can't deserialize object: [ 1447896135950 ] - ERROR: Unsupported version: 2023511133

Please help, i looked for the older version of JPCT but i cant find it anywhere :'(
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: EgonOlsen on November 19, 2015, 06:55:57 am
Just upgrade. Why are you using such ancient versions? Early versions didn't write the file version correctly.

BTW: There is no jPCT-AE 1.0. The versioning of -AE follows that of jPCT. And 1.15 didn't even have support for serializing objects. That has been added in 1.21. So something is fishy with your version numbers... ???
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: zoalord12 on November 19, 2015, 05:38:15 pm
yeah u r right.

i updated some jars and fixed another issue, i was compressing the file at one place but not decompressing before loading the object from a serialized version.

works now, thanks.

how do i fit model to screen ?  I looked at some examples online but they didnt help
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: EgonOlsen on November 19, 2015, 06:02:16 pm
how do i fit model to screen ?  I looked at some examples online but they didnt help
Depends on your needs. I usually do a trial and error approach.
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: zoalord12 on November 19, 2015, 06:41:00 pm
sadness has befallen me now , .......................

Isn't there a fit-to-screen type thing i can use ? in the camera  ?

I noticed i can calcBoundingBox and setBoundingBox on Object3D, but i cant get the one that's calculated ? did i miss something here

 if i can get that, i can fit the camera somehow
 
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: EgonOlsen on November 19, 2015, 08:18:02 pm
I noticed i can calcBoundingBox and setBoundingBox on Object3D, but i cant get the one that's calculated ? did i miss something here
You can get it from Object3D.getMesh().getBoundingBox(); (http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox() (http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox())). It's in object space coordinates. If you want them in world space, look here: http://www.jpct.net/wiki/index.php?title=Getting_Worldspace_Bounds (http://www.jpct.net/wiki/index.php?title=Getting_Worldspace_Bounds)

You can transform these coordinates into screen space by using the methods provided by Interact2D. So yes, you can calculated something but there's no magic fit()-method.
Title: Re: Serialization not working.... I serialize using JPCT 1.15 beta3
Post by: zoalord12 on November 19, 2015, 09:07:35 pm
thanks with this i can get it done.