Merge pull request 'Imporoved pinching for 3d fractals' (#22) from bugfix/betterPinching into main
All checks were successful
Build, Test & Push Frontend / quality-check (push) Successful in 17m23s
Build, Test & Push Frontend / docker (push) Successful in 53s

Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
2026-02-12 21:13:01 +01:00
2 changed files with 12 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { Component} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Information} from '../information/information'; import {Information} from '../information/information';
import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from '@angular/material/card'; import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from '@angular/material/card';
import {TranslatePipe} from '@ngx-translate/core'; import {TranslatePipe} from '@ngx-translate/core';
@@ -35,7 +35,7 @@ import {MatIcon} from '@angular/material/icon';
templateUrl: './fractal.component.html', templateUrl: './fractal.component.html',
styleUrl: './fractal.component.scss', styleUrl: './fractal.component.scss',
}) })
export class FractalComponent { export class FractalComponent implements OnInit {
algoInformation: AlgorithmInformation = { algoInformation: AlgorithmInformation = {
title: 'FRACTAL.EXPLANATION.TITLE', title: 'FRACTAL.EXPLANATION.TITLE',
entries: [ entries: [
@@ -85,10 +85,10 @@ export class FractalComponent {
selectedAlgorithm = 0; selectedAlgorithm = 0;
selectedColorScheme = 0; selectedColorScheme = 0;
zoom = 0.2; zoom = 0;
offsetX = 0.0; offsetX = 0;
offsetY = 0.0; offsetY = 0;
maxIterations = 100; maxIterations = 0;
juliaReal = -0.7; juliaReal = -0.7;
juliaImag = 0.27015; juliaImag = 0.27015;
@@ -103,6 +103,10 @@ export class FractalComponent {
material.setVector2("juliaC", new Vector2(this.juliaReal, this.juliaImag)); material.setVector2("juliaC", new Vector2(this.juliaReal, this.juliaImag));
}; };
ngOnInit() {
this.onReset();
}
onAlgorithmChange(algoName: string): void { onAlgorithmChange(algoName: string): void {
this.onReset() this.onReset()
@@ -127,6 +131,7 @@ export class FractalComponent {
this.zoom = 0.2; this.zoom = 0.2;
this.offsetX = 0.0; this.offsetX = 0.0;
this.offsetY = 0.0; this.offsetY = 0.0;
this.maxIterations = 100;
} }
onSceneReady(scene: Scene): void { onSceneReady(scene: Scene): void {

View File

@@ -91,6 +91,7 @@ export class BabylonCanvas implements AfterViewInit, OnDestroy {
private setup3dCamera(canvas: HTMLCanvasElement) { private setup3dCamera(canvas: HTMLCanvasElement) {
const cam = new ArcRotateCamera("Camera", 0, Math.PI / 2, 4, Vector3.Zero(), this.scene); const cam = new ArcRotateCamera("Camera", 0, Math.PI / 2, 4, Vector3.Zero(), this.scene);
cam.wheelPrecision = 100; cam.wheelPrecision = 100;
cam.pinchPrecision = 200;
cam.minZ = 0.1; cam.minZ = 0.1;
cam.maxZ = 100; cam.maxZ = 100;
cam.lowerRadiusLimit = 1.5; cam.lowerRadiusLimit = 1.5;