This commit is contained in:
Azgaar 2021-07-17 22:53:02 +03:00
parent 2502e1c916
commit 14b35cf93b

View file

@ -525,14 +525,11 @@
// render 3d scene and camera, do only on controls change // render 3d scene and camera, do only on controls change
const renderThrottled = throttle(doWorkOnRender, 200); const renderThrottled = throttle(doWorkOnRender, 200);
function render() { function render() {
console.log("render");
Renderer.render(scene, camera); Renderer.render(scene, camera);
renderThrottled(); renderThrottled();
} }
function doWorkOnRender() { function doWorkOnRender() {
console.log("doWorkOnRender");
for (const [i, label] of labels.entries()) { for (const [i, label] of labels.entries()) {
const dist = label.position.distanceTo(camera.position); const dist = label.position.distanceTo(camera.position);
const isVisible = dist < 80 * label.size && dist > label.size * 6; const isVisible = dist < 80 * label.size && dist > label.size * 6;