0

Within HTML I define 3 tour-waypoints. But after loading the JSON sceneStructure they are removed. Interestingly the camera holds an array of 3 waypoint entries, but they are all nil. Looks that they were deleted during sceneStructure loading.

How can that be avoided?

Code is to large to copy here, therefore as URL (sorry). Code with the problem can be found here:

http://archi.metason.net/tmp/buggy_space3d.html

  • 1
    Please provide some code example. While it's possible for someone to had the same problem you are experiencing, providing some code may help other people understand the core issue of yours. – kbariotis Nov 05 '17 at 22:40
  • Hi Philipp, in order to give you better support, please provide us with a bit of sample code. Loading a scene won't delete your waypoints by itself, but it does load a camera with waypoints if the scene contained any (they are called "camera-bookmark" in the JSON. – geekonaut Nov 06 '17 at 13:47

2 Answers2

0

you seem to have found an edge case in the code that loads a scene. When loading the scene, the camera + tour waypoints from the scene structure are added to the scene and used.

The problem is that there can only be one active camera and the question is what takes precedence: The camera (and tour waypoints) from the scene or from the initial HTML.

We will add to the documentation to explain this and the behaviour (the camera from the scene is given precedence). This can be circumvented by not adding the scene camera into your A-Frame scene:

io3d.scene.getAframeElementsFromSceneStructure(sceneStructure)
  .then(elements => elements.filter(elem => !elem.hasAttribute('camera'))
  .then(elements => elements.forEach(el => scene.appendChild(el))

You also hit an issue in our documentation which we're correcting right now!

Due to the possibility of multiple, identical titles in the camera waypoints, we have changed the library to use the additional io3d-uuid attribute for the goTo method:

<a-entity tour-waypoint="Esszimmer" io3d-uuid="ez" position="-0.0 1.6 -0.0" rotation="0 45.8 0"></a-entity>
<a-entity tour-waypoint="Wohnzimmer" io3d-uuid="wz" position="0.2 1.6 -2.8" rotation="0 152.9 0"></a-entity>
<a-entity tour-waypoint="Arbeitszimmer" io3d-uuid="az" position="-0.9 1.6 6.1" rotation="0 47.9 0"></a-entity>

and then use them like this:

document.getElementById('camera').components.tour.goTo('az')

Thank you for your question & the help in making 3d.io better for everyone!

geekonaut
  • 5,714
  • 2
  • 28
  • 30
0

root cause is probably the same as here: Waypoints animation issue at 3d.io

the aframe-animation-component in version 4 has a breaking change. To avoid that use the old version:

<script src="https://unpkg.com/aframe-animationcomponent@3.2.5/dist/aframe-animation-component.min.js"></script>

Frederic
  • 326
  • 1
  • 5