Skip to content

Instantly share code, notes, and snippets.

Created Jul 18, 2017
What would you like to do?
A-Frame Demo: Teleportation
<!DOCTYPE html>
<title>A-Frame-Demo 5</title>
<meta name="description" content="Teleportation mit JavaScript">
<meta charset="utf-8">
<script src=""></script>
function setScene2() {
document.querySelector('#scene1').setAttribute('visible', 'false');
document.querySelector('#scene2').setAttribute('visible', 'true');
function setScene1() {
document.querySelector('#scene2').setAttribute('visible', 'false');
document.querySelector('#scene1').setAttribute('visible', 'true');
<a-camera><a-entity cursor="fuse: true; fuseTimeout: 1500" position="0 0 -1" geometry="primitive: ring; radiusInner: 0.01; radiusOuter: 0.02" material="color: #ccc; shader: flat"></a-entity></a-camera>
<a-entity id="scene1">
<a-sky color="#ffffff"></a-sky>
<a-box id="test" color="green" position="1 0 -5" onclick="setScene2()"></a-box>
<a-entity id="scene2" visible="false">
<a-sky color="#aaaaaa"></a-sky>
<a-box color="yellow" position="-1 0 -5" onclick="setScene1()"></a-box>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment