|
Foamy Ether - A Framework for a Theory Of Everything Conceived and written by
Peter C.M. Hahn
C.E.T. |
//////////////////////////////////////////////////
// waveInflow.thd
// Simulates a lightwave traveling from a sun to a planet.
// The bottom
represents a non-expanding universe,
// but ether/space stretching as a
result of inflow.
//////////////////////////////////////////////////
// set background color
scene.backColor=RGB(92,92,98);
scene.gravity={0,0,0};
//scene.gravity={0,-.00981,0};
scene.shadow = false;
// 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 = "";
// set camera
scene.camera = {1000,500,-2500};
scene.lookAt = {1000,500,200};
// 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
= Cylinder({100,100,2}, {-100,0,0});
var texSun
= Texture("sun.jpg");
botLeft.useTexture(texSun);
botLeft.specular = RGB(255,255,255,0);
botLeft.sharpness = 50;
botLeft.emissive = 200;
var botRight
= Cylinder({100,100,2},
{width*spacing+100,0,0});
var texEarth
= Texture("earth.jpg");
botRight.useTexture(texEarth);
botRight.specular = RGB(255,255,255,0);
botRight.sharpness = 50;
botRight.emissive = 200;
var amp = 1000;
//make wave top
s2[4].move(0,amp,0);
s2[5].move(0,amp,0);
//make wave bottom
s[4].move(0,amp,0);
s[5].move(0,amp,0);
simulator.resetTime();
simulator.stepsize = .1;
var left = 1;
var right = width-1;
// stretch (reel in) ether
while (simulator.time
<= 900) {
simulator.run(50);
WaitFrame();
s[left].position =
{0,0,0};
s[left].static = true;
s[right].position =
{(width-1)*spacing,0,0};
s[right].static = true;
left++;
right--;
botLeft.rotate(0,0,-5);
botRight.rotate(0,0,5);
}
// pause for two seconds
for (var
i=0; i<30; i++){
WaitFrame();
};
|
Peter C.M. Hahn C.E.T. |
|