diff --git a/src/app/pages/algorithms/fractal/fractal.component.ts b/src/app/pages/algorithms/fractal/fractal.component.ts index b70ac0e..5025225 100644 --- a/src/app/pages/algorithms/fractal/fractal.component.ts +++ b/src/app/pages/algorithms/fractal/fractal.component.ts @@ -1,4 +1,4 @@ -import { Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Information} from '../information/information'; import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from '@angular/material/card'; import {TranslatePipe} from '@ngx-translate/core'; @@ -35,7 +35,7 @@ import {MatIcon} from '@angular/material/icon'; templateUrl: './fractal.component.html', styleUrl: './fractal.component.scss', }) -export class FractalComponent { +export class FractalComponent implements OnInit { algoInformation: AlgorithmInformation = { title: 'FRACTAL.EXPLANATION.TITLE', entries: [ @@ -85,10 +85,10 @@ export class FractalComponent { selectedAlgorithm = 0; selectedColorScheme = 0; - zoom = 0.2; - offsetX = 0.0; - offsetY = 0.0; - maxIterations = 100; + zoom = 0; + offsetX = 0; + offsetY = 0; + maxIterations = 0; juliaReal = -0.7; juliaImag = 0.27015; @@ -103,6 +103,10 @@ export class FractalComponent { material.setVector2("juliaC", new Vector2(this.juliaReal, this.juliaImag)); }; + ngOnInit() { + this.onReset(); + } + onAlgorithmChange(algoName: string): void { this.onReset() @@ -127,6 +131,7 @@ export class FractalComponent { this.zoom = 0.2; this.offsetX = 0.0; this.offsetY = 0.0; + this.maxIterations = 100; } onSceneReady(scene: Scene): void { diff --git a/src/app/shared/rendering/canvas/babylon-canvas.component.ts b/src/app/shared/rendering/canvas/babylon-canvas.component.ts index 8eb1fc9..55d3a79 100644 --- a/src/app/shared/rendering/canvas/babylon-canvas.component.ts +++ b/src/app/shared/rendering/canvas/babylon-canvas.component.ts @@ -91,6 +91,7 @@ export class BabylonCanvas implements AfterViewInit, OnDestroy { private setup3dCamera(canvas: HTMLCanvasElement) { const cam = new ArcRotateCamera("Camera", 0, Math.PI / 2, 4, Vector3.Zero(), this.scene); cam.wheelPrecision = 100; + cam.pinchPrecision = 200; cam.minZ = 0.1; cam.maxZ = 100; cam.lowerRadiusLimit = 1.5;