0

I have a development code issues use open source for '3dio-js' code.

How to will

<a-entity class="io3d-scene" position="" rotation="" io3d-uuid="ddd8f1a11-7f5fs-4fds4-ad3d-ec58cc2cssa817" scale="" visible="">all elements are children </a-entity>

convert to:

  {   "type": "plan",   "children": [
        {
          "type": "level",
          "children": [
             {
               "type": "interior"
             }
             // all elements are children of the level
          ]
        }
 ] }

Do you have a code example?

Thank you very much.

Hande Xu
  • 3
  • 2
  • 1
    Possible duplicate of [How can I offload Object3d.toJSON() operation to a web worker?](https://stackoverflow.com/questions/46432201/how-can-i-offload-object3d-tojson-operation-to-a-web-worker) – Manmohan_singh May 07 '18 at 04:01

1 Answers1

0

you can do that with the io3d.scene.getSceneStructureFromAframeElements() method https://3d.io/docs/api/1/scene.html#get-scene-structure-from-a-frame-elements

<a-scene>
  <a-entity io3d-furniture="id:3aff54e2-fdff-44a3-9646-f2db1ea3bbfc" position="3.4 0 1.4"></a-entity>
</a-scene>

<script>
  const el = document.querySelector('[io3d-furniture]')
  const sceneStructure = io3d.scene.getSceneStructureFromAframeElements(el)

  console.log(sceneStructure)

  // result:
  // {
  //   "type": "interior",
  //   "x": 3.4,
  //   "y": 0,
  //   "z": 1.4,
  //   "src": "!3aff54e2-fdff-44a3-9646-f2db1ea3bbfc"
  // }
</script>
Frederic
  • 326
  • 1
  • 5
  • Hi,Frederic. Can you look this issue? https://stackoverflow.com/questions/51687107/how-to-loading-furniture-the-data3d-buffer-of-the-local-request – Hande Xu Aug 04 '18 at 15:41