Author Topic: Serialization not working.... I serialize using JPCT 1.15 beta3  (Read 3021 times)

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
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 :'(

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #1 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... ???
« Last Edit: November 19, 2015, 08:34:58 am by EgonOlsen »

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #2 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #3 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.

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #4 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
 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #5 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()). 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

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.

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Serialization not working.... I serialize using JPCT 1.15 beta3
« Reply #6 on: November 19, 2015, 09:07:35 pm »
thanks with this i can get it done.