TransformControl does not keep position of mesh

Hello,

If I create a mesh element and move it (translate) with Transform Controls I can see that the position of mesh has changed (in console). But if I export this scene to JSON with:

  scene.updateMatrixWorld();
  var result=scene.toJSON();
  var output =JSON.stringify(result);
  download(output, 'scene.json', 'application/json');

and load the scene again, it keeps the original position of mesh (before translate).

Is there a way to ‘save’ this transform effect?

Many thanks!
Mirko

Hi again,

this has clearly something to do only with meshes created from ExtrudeBufferGeometry. Meshes from other geometries (like BoxGeometry) work fine.

Mirko

Hi, could you please share a jsfiddle that recreates this issue with ExtrudeBufferGeometry and the controls? I’ve been using the combo of those 2 in a few projects and they did seem to work just fine.

Also, which version of three are you seeing it on?

Hello mjurczyk,

Fiddle is here: https://jsfiddle.net/3vrp16go/6/

However I have some issues, while trying to run it as it throws error (‘Three is not defined’).

As you can see in the code:

  • I click on the Draw Walls and with mouse I make couple of clicks - lines show up

  • I click on ‘Make Walls’ and it creates shape out of those lines (function: makeWalls)

  • I click on ‘Transform’ and click on this shape - transform controls are on the middle of the scene, not above the object (first issue)

  • I save the scene (as JSON)

  • I load the scene

  • I try to do transformations on the object after scene is loaded - nothing happens.

Thanks a lot for helping me to understand this.