p3nGu1nZz commited on
Commit
d502220
·
1 Parent(s): abb941d

update comments

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -78,7 +78,7 @@ async function main() {
78
  let lastTime = performance.now();
79
  function update() {
80
  const currentTime = performance.now();
81
- const deltaTime = (currentTime - lastTime) / 1000; // Convert to seconds
82
  state.time += deltaTime;
83
  const fov = 60 * Math.PI / 180;
84
  const aspect = canvas.clientWidth / canvas.clientHeight;
@@ -100,7 +100,7 @@ async function main() {
100
  state.device.queue.submit([encoder.finish()]);
101
 
102
  lastTime = currentTime;
103
- setTimeout(update, 16); // Approximate 60 FPS
104
  }
105
 
106
  update();
 
78
  let lastTime = performance.now();
79
  function update() {
80
  const currentTime = performance.now();
81
+ const deltaTime = (currentTime - lastTime) / 1000; //seconds
82
  state.time += deltaTime;
83
  const fov = 60 * Math.PI / 180;
84
  const aspect = canvas.clientWidth / canvas.clientHeight;
 
100
  state.device.queue.submit([encoder.finish()]);
101
 
102
  lastTime = currentTime;
103
+ setTimeout(update, 16); //60fps
104
  }
105
 
106
  update();