scale factor for node foreshortening

feature-alt-projections
Mike Lynch 2024-04-14 16:08:46 +10:00
parent cab5878ac8
commit 1e5db22c25
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import * as THREE from 'three';
const HYPERPLANE = 2.0; const HYPERPLANE = 2.0;
const NODE_FORESHORTENING = 0.4;
class FourDShape extends THREE.Group { class FourDShape extends THREE.Group {
@ -154,7 +154,7 @@ class FourDShape extends THREE.Group {
const v4 = this.fourDrotate(n.x, n.y, n.z, n.w, rotations); const v4 = this.fourDrotate(n.x, n.y, n.z, n.w, rotations);
const k = this.fourDscale(v4.w); const k = this.fourDscale(v4.w);
const v3 = new THREE.Vector3(v4.x * k, v4.y * k, v4.z * k); const v3 = new THREE.Vector3(v4.x * k, v4.y * k, v4.z * k);
const s4 = k * this.node_scale; const s4 = k * this.node_scale * NODE_FORESHORTENING;
const s3 = new THREE.Vector3(s4, s4, s4); const s3 = new THREE.Vector3(s4, s4, s4);
this.nodes3[n.id].v3 = v3; this.nodes3[n.id].v3 = v3;
this.nodes3[n.id].object.position.copy(v3); this.nodes3[n.id].object.position.copy(v3);