Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Aug 21, 2024
1 parent b1de38f commit dc314fc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
6 changes: 1 addition & 5 deletions threejs/galaxy/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
38 changes: 0 additions & 38 deletions threejs/galaxy/shaders/galaxy/vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dc314fc

Please sign in to comment.