aframe-360-tour
aframe-360-tour copied to clipboard
Simple 360 tour built using A-frame
360 tour built using A-Frame
String together a tour using 360° panorama images.
Usage
Basic setup
-
Include the primitive and component scripts needed for the tour along with A-Frame
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> <script src="primitives/tour.js"></script> <script src="primitives/hotspot.js"></script>
-
Setup the tour and define panorama images
<a-tour> <a-panorama id="livingroom" src="images/livingroom.jpg"></a-panorama> <a-panorama id="kitchen" src="images/kitchen.jpg"></a-panorama> </a-tour>
-
Define the hotspots for each panorama
<a-tour> <!-- sets a hotspot from livingroom to kitchen --> <a-hotspot for="livingroom" to="kitchen" mixin="hotspot-target" position="5 0 0"></a-hotspot> <!-- sets a hotspot from kitchen to livingroom --> <a-hotspot for="kitchen" to="livingroom" mixin="hotspot-target" position="2 0 5"></a-hotspot> </a-tour>
-
Style hotspots
We use a mixin to set the hotspot style:
<a-assets> <a-mixin id="hotspot-target" geometry="primitive: sphere; radius: 0.15" material="color: yellow"></a-mixin> </a-assets>