This commit is contained in:
Adrien MALINGREY 2023-06-11 00:59:03 +02:00
parent 2f3b06d9d5
commit 3287bf7035

7
app.js
View File

@ -1,5 +1,6 @@
import * as THREE from 'three' import * as THREE from 'three'
import { OrbitControls } from 'three/addons/controls/OrbitControls.js' import { OrbitControls } from 'three/addons/controls/OrbitControls.js'
import * as FPS from 'three/addons/libs/stats.module.js';
let P = (x, y, z=0) => new THREE.Vector3(x, y, z) let P = (x, y, z=0) => new THREE.Vector3(x, y, z)
@ -835,6 +836,10 @@ controls.maxAzimuthAngle = 2.14 - Math.PI/2
controls.target = P(5, 9) controls.target = P(5, 9)
controls.update() controls.update()
const showFPS = window.location.search.includes("fps")
const fps = new FPS.default();
if (showFPS) document.body.appendChild(fps.dom);
const GLOBAL_ROTATION = 0.0025 const GLOBAL_ROTATION = 0.0025
@ -956,6 +961,8 @@ function animate() {
renderer.render(scene, camera) renderer.render(scene, camera)
minoCamera.update(renderer, scene) minoCamera.update(renderer, scene)
if (showFPS) fps.update();
} }