Code:
Yellow = Color3f(1,1,0);
White = Color3f(1,1,1);
LtWhite = Color3f(0.7,0.7,0.7);
NumberOfFrames = 1;
FrameNumber = 0;
SphereY1 = -0.8;
SphereY2 = -0.5;
DeltaY = 4 * math.sin((math.pi)*(FrameNumber/NumberOfFrames));
--define the scene
SetCamera{
location = {0,0,-5},
look_at = {0,0,0}
};
NewPlane{
name = "ground plane",
normal = {0, 1, 0},
location = {0,-4.4,0},
color = {0.4, 0.3, 0.3},
reflection = 0,
diffuse = 1
};
Sphere1 = NewSphere{
name = "big sphere",
location = {1, SphereY1 - DeltaY, 3},
radius = 2.5,
color = LtWhite,
reflection = 0.6,
};
Sphere2 = NewSphere{
name = "small sphere",
location = {-5.5,SphereY2 + DeltaY,7},
radius = 2,
color = {0.7,0.7,1},
reflection = 1,
diffuse = 0.1
};
NewLight{
location = {0,5,5},
color = {0.6,0.6,0.6},
radius = 0.1
};
NewLight{
location = {2,5,1},
color = {0.7,0.7,0.9},
radius = 0.1
};
--animate the scene and create an output file for each frame
while FrameNumber < NumberOfFrames do
MoveObjectTo(Sphere1,1, SphereY1 - DeltaY, 3);
MoveObjectTo(Sphere2,-5.5,SphereY2 + DeltaY,7);
FileName = GenerateNumberedTGAFileName("testscene",FrameNumber);
RenderScene(800,600,FileName);
FrameNumber= FrameNumber+ 1;
DeltaY = 4 * math.sin((math.pi)*(FrameNumber/NumberOfFrames));
end;
For now, enjoy the .exe file (code to follow when tidied up and more complete)
Bookmarks