Author Topic: Scaling bug with XML export?  (Read 8913 times)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Scaling bug with XML export?
« 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.

Offline JavaMan

  • long
  • ***
  • Posts: 231
    • View Profile
Re: Scaling bug with XML export?
« Reply #1 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Scaling bug with XML export?
« Reply #2 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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: Scaling bug with XML export?
« Reply #3 on: May 11, 2008, 04:47:31 pm »
Cool, I'll just stick with the post loading scaling for now :)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: Scaling bug with XML export?
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Scaling bug with XML export?
« Reply #5 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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: Scaling bug with XML export?
« Reply #6 on: May 14, 2008, 10:31:18 pm »
Ahhhh, I understand.