innerHTML template for scaffolding

scaffolding
Fabien Benetou 6 months ago
parent e84257a92b
commit f2f51341a7
  1. 120
      index.html

@ -13,6 +13,35 @@
<body> <body>
<script> <script>
scaffoldingInnerHTMLTemplate = `
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>`
setTimeout( _ => {
let rot = "0 0 0"
let positions = [ "-1 1 -3.5", "-1 2 -3.5", "0 0 -3.5", "0 1 -3.5", "1 0 -3.5", "-1 0 -3.5" ]
// triangle example, could be based on room boundaries instead
positions.map( pos => {
let el = document.createElement("a-entity")
el.innerHTML = scaffoldingInnerHTMLTemplate
AFRAME.scenes[0].appendChild(el)
el.setAttribute("position", pos)
el.setAttribute("rotation", rot)
})
}, 2000)
var forceXaxis var forceXaxis
// setInterval( _ => console.log(forceXaxis), 1000) // setInterval( _ => console.log(forceXaxis), 1000)
@ -382,97 +411,6 @@ setTimeout( _ => {
<a-box id="namedteleporter" teleporter height=".1" class="teleportable" material="color: cyan" position="2 0 2" ></a-box> <a-box id="namedteleporter" teleporter height=".1" class="teleportable" material="color: cyan" position="2 0 2" ></a-box>
<a-box target teleporter height=".1" depth=".1" width=".1" class="teleportable" material="color: red" position="0 1 -.5" ></a-box> <a-box target teleporter height=".1" depth=".1" width=".1" class="teleportable" material="color: red" position="0 1 -.5" ></a-box>
<a-entity position="-1 1 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
<a-entity position="-1 2 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
<a-entity position="0 0 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
<a-entity position="0 1 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
<a-entity position="1 0 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
<a-entity position="-1 0 -3.5" scaffolding>
<a-box teleporter height=".01" depth=".4" width="1" class="teleportable" material="color: white" position=".5 0 -.2" ></a-box>
<a-entity position="0 0.5 0" class="scaffolding_front">
<a-cylinder radius=".05"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="0 -.5 -.2" rotation="90 0 0"></a-cylinder>
</a-entity>
<a-entity position="0 0.5 -.4" class="scaffolding_back">
<a-cylinder radius=".05" position="0 0 0"></a-cylinder>
<a-cylinder radius=".05" position=".5 -.5 0" rotation="0 0 90"></a-cylinder>
<a-cylinder radius=".05" height=1.2 position=".5 0 0" rotation="0 0 -45"></a-cylinder>
<a-cylinder radius=".05" height=".4" position="1 -.5 .2" rotation="90 0 0"></a-cylinder>
</a-entity>
</a-entity>
</a-scene> </a-scene>
</body> </body>
</script> </script>

Loading…
Cancel
Save