-
@@ -17,9 +38,6 @@
main {
height: 100%;
}
- #button {
- display: flex;
- }
#container {
height: inherit;
display: flex;
diff --git a/www/src/components/test3D.svelte b/www/src/pages/test3D.svelte
similarity index 80%
rename from www/src/components/test3D.svelte
rename to www/src/pages/test3D.svelte
index f8952e9..d86b84c 100644
--- a/www/src/components/test3D.svelte
+++ b/www/src/pages/test3D.svelte
@@ -3,52 +3,49 @@
import { beforeUpdate, afterUpdate } from 'svelte';
import * as Three from 'three';
-//#region variables
+ //#region variables
let innerWidth: number = 0;
let innerHeight: number = 0;
let maxInnerWidth: number = 0;
let maxInnerHeight: number = 0;
let portrait: boolean = true;
- let focalLength: number = (540/Math.atan(70*Math.PI / 180));
+ let focalLength: number = 540 / Math.atan((70 * Math.PI) / 180);
let fov = 75;
//let baseHorizontalFOV: number = 2.0*Math.atan(baseAspectRation*Math.tan(baseVerticalFOV*0.5));
-//#endregion
+ //#endregion
-
-//#region functions
- function updateVerticalFOV(){
- fov = (180/Math.PI)*Math.tan(innerHeight/(focalLength*2));
+ //#region functions
+ function updateVerticalFOV() {
+ fov = (180 / Math.PI) * Math.tan(innerHeight / (focalLength * 2));
}
-
- function resetMaxDimensions(){
+ function resetMaxDimensions() {
maxInnerWidth = 0;
maxInnerHeight = 0;
}
- function updateMaxInnerDimensions(){
- if(maxInnerWidth < innerWidth){
+ function updateMaxInnerDimensions() {
+ if (maxInnerWidth < innerWidth) {
maxInnerWidth = innerWidth;
}
- if(maxInnerHeight < innerHeight){
+ if (maxInnerHeight < innerHeight) {
maxInnerHeight = innerHeight;
}
}
- function checkOrientation(oldPortrait: boolean){
- if (innerWidth > innerHeight){
+ function checkOrientation(oldPortrait: boolean) {
+ if (innerWidth > innerHeight) {
portrait = false;
} else {
portrait = true;
}
- if (oldPortrait != portrait){
+ if (oldPortrait != portrait) {
resetMaxDimensions();
}
}
-//#endregion
-
+ //#endregion
let scene: Three.Scene = new Three.Scene();
let camera: Three.PerspectiveCamera = new Three.PerspectiveCamera(
@@ -97,7 +94,7 @@
updateVerticalFOV();
camera.aspect = innerWidth / innerHeight;
- camera.fov = fov
+ camera.fov = fov;
camera.setViewOffset(
window.innerWidth,
window.innerHeight,
@@ -111,9 +108,7 @@
//renderer.setClearColor(0x000000, (innerHeight/(maxInnerHeight))/2 + 0.5);
});
- afterUpdate(() => {
-
- });
+ afterUpdate(() => {});