Foamy Ether - A Framework for a
Theory Of Everything

Conceived and written by Peter C.M. Hahn C.E.T.
 
Copyright © 2005-2007

 

//////////////////////////////////////////////////

// waveExpanding.thd

// Simulates a lightwave traveling from a sun to a planet.

// The bottom represents an expanding universe

// and illustrates the red shift as ether/space stretches.

//////////////////////////////////////////////////

 

// set background color

scene.backColor=RGB(92,92,98);

scene.gravity={0,0,0};

//scene.gravity={0,-.00981,0};

scene.shadow = false;

 

// set camera

scene.camera = {1000,500,-2500};

scene.lookAt = {1000,500,200};

 

// use degrees as metric for angles

factory.useDegrees = true;

 

// choose some default material

//Material (density, springConstant, dampingConstant, staticFriction, dynamicFriction, thresholdVelocity);

var mat = Material(1e-5, .0005, .001, 1, 1);

factory.material = mat ;

factory.detectCollision = false;

 

 

var green = RGB(108, 255, 108);

var white = RGB(200, 200, 200);

var red = RGB(150, 0, 0);

 

var spngCnst = .000001; // set spring constant

var dmpCnst = .000001; // set damper constant

 

// build array of balls

var width = 100; // enter number of balls for array width

var depth = 1; // enter number of balls for array depth

var spacing = 20; // enter spacing between balls

var ball = "";

var counter = 0;

 

// make bottom line

var s = array();

for (var x=0; x < width; x++) {

   ball = Sphere(1.5, {x*spacing,0,0});

   //ball.color = green;

   ball.visible = false;

   // set all outer edge balls as stationary

   if (x==0||x==width-1){

      ball.static = true;

   }

   s.append(ball);

}

 

// build array of springs and dampers attaching to balls on x axis

var spx = array();

var dpx = array();

var dmpr = "";

var sprng = "";

for (x=0; x < width-1; x++) {

   sprng = Spring(s[x],{0,0,0},s[x+1],{0,0,0});

   sprng.springConstant = spngCnst;

   spx.append(sprng);

   var dmpr = Damper(s[x],{0,0,0},s[x+1],{0,0,0});

   dmpr.damperConstant = dmpCnst;

   //alternate colors in segments of 10

   if ((x/10)%2 == 1){

      dmpr.color = green;

   }else{

      dmpr.color = red;

   }

   dpx.append(dmpr);

}

 

//dpx[0].damperConstant = .001;

 

// make top line

var s2 = array();

for (x=0; x < width; x++) {

   ball = Sphere(1.5, {x*spacing,900,0});

   //ball.color = green;

   ball.visible = false;

   // set all outer edge balls as stationary

   if (x==0||x==width-1){

      ball.static = true;

   }

   s2.append(ball);

}

// build array of springs and dampers attaching to balls on x axis

var spx2 = array();

var dpx2 = array();

for (x=0; x < width-1; x++) {

   sprng = Spring(s2[x],{0,0,0},s2[x+1],{0,0,0});

   sprng.springConstant = spngCnst;

   spx2.append(sprng);

   var dmpr = Damper(s2[x],{0,0,0},s2[x+1],{0,0,0});

   dmpr.damperConstant = dmpCnst;

   //alternate colors in segments of 10

   if ((x/10)%2 == 1){

      dmpr.color = green;

   }else{

      dmpr.color = red;

   }

   dpx2.append(dmpr);

}

 

// make end balls

var topLeft = Sphere(100, {-100,900,0});

topLeft.color = RGB(255, 255, 0);

 

var topRight = Sphere(100, {width*spacing+100,900,0});

topRight.color = RGB(0, 0, 255);

 

var botLeft = Sphere(100, {-100,0,0});

botLeft.color = RGB(255, 255, 0);

 

var botRight = Sphere(100, {width*spacing+100,0,0});

botRight.color = RGB(0, 0, 255);

 

 

var amp = 1000;

//make wave top

s2[2].move(0,amp,0);

s2[3].move(0,amp,0);

 

//make wave bottom

s[2].move(0,amp,0);

s[3].move(0,amp,0);

 

var step = 20;

simulator.resetTime();

simulator.stepsize = .1;

 

// stretch ether

while (simulator.time <= 1100) {

   simulator.run(35);

   WaitFrame();

   //bottom

   s[0].move(-step,0,0);

   s[width-1].move(step ,0,0);

   botLeft.move(-step,0,0);

   botRight.move(step ,0,0);

}

 

// pause for two seconds

for (var i=0; i<30; i++){

   WaitFrame();

};

   

Peter C.M. Hahn C.E.T.