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!