www.jpct.net

jPCT - a 3d engine for Java => Bugs => Topic started by: mystara on May 10, 2008, 05:45:13 pm

Title: Scaling bug with XML export?
Post by: mystara on May 10, 2008, 05:45:13 pm
Hello,

If I import a model, and then use .setScale on the corresponding Object3D, the scale of a model can be set.
If I export the world using World.toXML(), however, the XML file stores the scale of the original model file, not the scale as set by the .setScale command.

Is this intentional behaviour? I would have expected the exported XML file to reflect the scale set with the .setScale command.
Title: Re: Scaling bug with XML export?
Post by: JavaMan on May 11, 2008, 02:58:09 am
I don't think so. Scaling I think does not affect the actual mesh coordinate data. So, when you export it the xml file saves the original data. If I understand it correctly.

Jman
Title: Re: Scaling bug with XML export?
Post by: EgonOlsen on May 11, 2008, 10:52:39 am
However, it should be possible to add the scaling as an attribute to the xml and reapply it after loading. I'll look into it. The xml format hasn't been t0uched for years. It can very well be, that it lacks support for this.
Title: Re: Scaling bug with XML export?
Post by: mystara on May 11, 2008, 04:47:31 pm
Cool, I'll just stick with the post loading scaling for now :)
Title: Re: Scaling bug with XML export?
Post by: mystara on May 14, 2008, 09:45:56 pm
Interestingly, if I load a 3DS model via Loader.load3DS and specify the scale in there, then that scale is reflected in the XML output.

It's ignored if the scale it set via the setScale function of the model object.
Title: Re: Scaling bug with XML export?
Post by: EgonOlsen on May 14, 2008, 09:55:30 pm
That's because the loader modifies the mesh while the setScale()-method only affects world transformations, but not the mesh data itself.
Title: Re: Scaling bug with XML export?
Post by: mystara on May 14, 2008, 10:31:18 pm
Ahhhh, I understand.