Just to back up John's comment... I spent about 20 hours trying to figure
out why the texture coordinates of the 2nd texture unit were coming back
wrong after I wrote them out correctly.  So a piece of geometry would save
fine and when loaded the detail texture would be all screwed up.  I even had
it to the point where I printed out everything that I saved, and then
printed it out when it came back in... and darn if it didn't duplicate the
texture unit 1 into the texture unit 2 coordinates.

Turns out that to "save memory defragmentation" I had created an array of
float and then used the same array to get and save the two sets of texture
coordinates... but writeObject(floatArray) thought that I was writing out
the same object so just put a reference to the first array, even though I
had changed the contents...

Thats the types of serilization wierdnesses you can get.

Dave Yazel

-----Original Message-----
From: John Wright [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Seralization of 3D objects


Serialization is seriously flawed in Java, the probability of writing
malfunctioning code using serialization is way too easy.  There are two
"bug" reports that Sun states are not bugs yet dozens of comments saying
this is not the expected behavior (by the average programmer).

Java really has missed the boat for easy data storage.  I really miss
the good old Modula 2 days when I could just write "readRecord()" and
"writeRecord()" to read and write complex data structures.

- John Wright
Starfire Research

Justin Couch wrote:
>
> Firas MOHAMED wrote:
>
> > I am trying to save my 3D objects (GeometryInfo, for example) by using
> >
> > serialization ... But this does not work as these objects are not
> > serializable.
>
> Serialisation of Java classes has to be one of the worst approaches to
> data transport and (shared) replication. There are many much more
> efficient schemes for doing this. Not only is serialisation horribly
> slow, but the chances that it works on more than just your local machine
> are even worse. I suggest you look at some other scheme for geometry
> persistence or even if you are using them over RMI for shared
> representations, there are far, far better ways of doing this.
>
> --
> Justin Couch                         http://www.vlc.com.au/~justin/
> Freelance Java Consultant                  http://www.yumetech.com/
> Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
> -------------------------------------------------------------------
> "Humanism is dead. Animals think, feel; so do machines now.
> Neither man nor woman is the measure of all things. Every organism
> processes data according to its domain, its environment; you, with
> all your brains, would be useless in a mouse's universe..."
>                                               - Greg Bear, Slant
> -------------------------------------------------------------------
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to