Add working translation to sphere coordinates
This commit is contained in:
+17
-21
@@ -1,26 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Is it working?</h1>
|
||||
<button id="perm">click me for permissions</button>
|
||||
<div style="color: red" id="disp">lalala</div>
|
||||
<script>
|
||||
document.querySelector("#perm").addEventListener("click", e => {
|
||||
const ac = new AudioContext();
|
||||
const osc = ac.createOscillator();
|
||||
|
||||
osc.type = "square";
|
||||
osc.frequency.setValueAtTime(440, ac.currentTime);
|
||||
osc.connect(ac.destination);
|
||||
osc.start();
|
||||
|
||||
DeviceMotionEvent.requestPermission().then(response => {
|
||||
window.addEventListener("devicemotion", e => {
|
||||
document.querySelector("#disp").innerHTML = Math.round(e.acceleration.x);
|
||||
osc.frequency.setValueAtTime(440 * Math.pow(2, e.acceleration.x / 10), ac.currentTime);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h1>Is it working?</h1>
|
||||
<button id="perm">click me for permissions</button>
|
||||
<canvas width="200" height="200" id="canvas"></canvas>
|
||||
<script src="m3.js"></script>
|
||||
<script src="util.js"></script>
|
||||
<script src="v3.js"></script>
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user