From dc314fc013c7260d0c9aa60ef31fc938a4c2aa99 Mon Sep 17 00:00:00 2001 From: Juan Carlos Ponce Campuzano <37394697+jcponce@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:56:37 +1000 Subject: [PATCH] ok --- threejs/galaxy/script.js | 6 +--- threejs/galaxy/shaders/galaxy/vertex.glsl | 38 ----------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/threejs/galaxy/script.js b/threejs/galaxy/script.js index c0f73c04..884a4e66 100644 --- a/threejs/galaxy/script.js +++ b/threejs/galaxy/script.js @@ -43,7 +43,7 @@ function initializeScene() { parameters.randomness = 0.5 parameters.randomnessPower = 3 parameters.insideColor = '#2e74ff' - parameters.outsideColor = '#6de9e7' + parameters.outsideColor = '#f77118' let geometry = null let material = null @@ -80,10 +80,6 @@ function initializeScene() { positions[i3] = Math.cos(branchAngle) * radius positions[i3 + 1] = 0 positions[i3 + 2] = Math.sin(branchAngle) * radius - - // positions[i3] = (Math.random() - 0.5) * 5 - // positions[i3 + 1] = (Math.random() - 0.5) * 5 - // positions[i3 + 2] = (Math.random() - 0.5) * 5 // Randomness diff --git a/threejs/galaxy/shaders/galaxy/vertex.glsl b/threejs/galaxy/shaders/galaxy/vertex.glsl index 4e65e76c..a6c88ef0 100644 --- a/threejs/galaxy/shaders/galaxy/vertex.glsl +++ b/threejs/galaxy/shaders/galaxy/vertex.glsl @@ -39,44 +39,6 @@ void main(){ // Randomness modelPosition.xyz += aRandomness; - // // Lorenz system - // vec3 pos = modelPosition.xyz; // Introduce some initial randomness - // float dt = 0.01 * uTime; // Small time step scaled by uTime - - // for (int i = 0; i < 10; i++) { // Accumulate the motion over multiple small steps - // float dx = uSigma * (pos.y - pos.x); - // float dy = pos.x * (uRho - pos.z) - pos.y; - // float dz = pos.x * pos.y - uBeta * pos.z; - - // pos.x += dx * dt; - // pos.y += dy * dt; - // pos.z += dz * dt; - // } - - // modelPosition.xyz = pos; - - // Apply the Lorenz system - // float dt = 1.01 * uTime; // Scale time for better control - // vec3 newPosition = thomas(modelPosition.xyz, dt); - // modelPosition = vec4(newPosition, 1.0); - - // Apply the Thomas attractor directly to the initial position - // vec3 newPosition = position; - - // Time factor for attractor dynamics - // float totalTime = uTime * 0.0001; // Adjust this to control speed - // for (int i = 0; i < 100; i++) { // Increase the iteration count for smoother paths - // newPosition = thomas(newPosition, totalTime); - // } - - // Damping to prevent expansion - //float damping = 0.79; // Damping factor (less than 1 to reduce expansion) - //newPosition *= damping; - - - //vec4 modelPosition = modelMatrix * vec4(newPosition, 1.0); - - vec4 viewPosition = viewMatrix * modelPosition; vec4 projectedPosition = projectionMatrix * viewPosition; gl_Position = projectedPosition;