概要
plnkerでa-frameやってみた。
physicsやってみた。
サンプルコード
let container = document.querySelector("#container")
function run() {
let x = Math.random() * 6 - 3
let y = 5
let z = -4
container.innerHTML = `<a-sphere dynamic-body="mass: 0.5" position="${x} ${y} ${z}" radius="0.5" color="aqua" ></a-sphere>`
setTimeout(run, 3000);
}
run();
成果物
以上。