Scaling bug with XML export?

Started by mystara, May 10, 2008, 05:45:13 PM

Previous topic - Next topic

mystara

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.

JavaMan

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

EgonOlsen

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.

mystara

Cool, I'll just stick with the post loading scaling for now :)

mystara

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.

EgonOlsen

That's because the loader modifies the mesh while the setScale()-method only affects world transformations, but not the mesh data itself.

mystara