From f039f98b612835622d979e63d8cbfb154faff153 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Thu, 18 May 2023 18:04:10 -0600 Subject: [PATCH] on stats-world: adjust some lighting and position, and add an attempt at a screen-capture --- project.yaml | 2 +- src/components/World/World.js | 2 +- src/components/World/components/camera.js | 2 +- src/components/World/components/lights.js | 2 +- src/components/World/systems/controls.js | 2 + src/views/StatisticsView.vue | 98 ++++++++++++++++++++++- 6 files changed, 102 insertions(+), 6 deletions(-) diff --git a/project.yaml b/project.yaml index d7936ec7..2931bb79 100644 --- a/project.yaml +++ b/project.yaml @@ -39,7 +39,7 @@ - .5 make advanced features harder to access - Release Minimum Viable Product : - - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world). + - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world, cannot screenshot). - Stats : - 01 point out user's location on the world diff --git a/src/components/World/World.js b/src/components/World/World.js index 5a602c96..154244ea 100644 --- a/src/components/World/World.js +++ b/src/components/World/World.js @@ -47,7 +47,7 @@ class World { this.lights = []; this.bushes = []; - // Initializae Loop + // Initialize Loop this.loop = new Loop(this.camera, this.scene, this.renderer); container.append(this.renderer.domElement); diff --git a/src/components/World/components/camera.js b/src/components/World/components/camera.js index 7eac6c58..e561cc53 100644 --- a/src/components/World/components/camera.js +++ b/src/components/World/components/camera.js @@ -5,7 +5,7 @@ function createCamera() { 35, // fov = Field Of View 1, // aspect ratio (dummy value) 0.1, // near clipping plane - 300 // far clipping plane + 350 // far clipping plane ); // move the camera back so we can view the scene diff --git a/src/components/World/components/lights.js b/src/components/World/components/lights.js index bcc38fb3..8071335e 100644 --- a/src/components/World/components/lights.js +++ b/src/components/World/components/lights.js @@ -3,7 +3,7 @@ import { DirectionalLight, DirectionalLightHelper } from "three"; function createLights(color) { const light = new DirectionalLight(color, 4); const lightHelper = new DirectionalLightHelper(light, 0); - light.position.set(60, 60, 30); + light.position.set(60, 100, 30); // eslint-disable-next-line @typescript-eslint/no-empty-function light.tick = () => {}; diff --git a/src/components/World/systems/controls.js b/src/components/World/systems/controls.js index 7ffa178e..310b7b02 100644 --- a/src/components/World/systems/controls.js +++ b/src/components/World/systems/controls.js @@ -26,6 +26,8 @@ function createControls(camera, canvas) { controls.enableDamping = true; //controls.enableZoom = false; + controls.maxDistance = 250; + //controls.enablePan = false; controls.tick = () => controls.update(); diff --git a/src/views/StatisticsView.vue b/src/views/StatisticsView.vue index 34c41fb7..e1281c97 100644 --- a/src/views/StatisticsView.vue +++ b/src/views/StatisticsView.vue @@ -54,21 +54,115 @@ Your Statistics + +