This commit is contained in:
STP
2023-11-26 07:56:36 -05:00
parent 2e70fc9a68
commit 8ab9be8056
11 changed files with 334 additions and 35 deletions

View File

@@ -1,20 +1,33 @@
let scene = Scene();
let material = Material(V(0.5,0.5,0.5), V(0.8, 0.8, 0.8), 25.0);
let material = Material(V(0.2,0.2,0.2), V(0.2, 0.8, 0.8), 10.0);
//let ambient = Light(P(10.0,0.0,0.0), V(1.0,1.0,1.0), V(0.0, 0.0, 0.0));
//scene.addLight(ambient);
let light = Light(P(3.0,3.0,1.0), V(0.0,1.0,1.0), V(0.1, 0.01, 0.001));
let light = Light(P(0.0,7.0,0.0), V(0.0,0.0,1.0), V(0.1, 0.01, 0.001));
scene.addLight(light);
let light = Light(P(2.0,7.0,0.0), V(0.0,1.0,0.0), V(0.1, 0.01, 0.001));
scene.addLight(light);
let light = Light(P(-2.0,7.0,0.0), V(1.0,0.0,0.0), V(0.1, 0.01, 0.001));
scene.addLight(light);
let light = Ambient(V(0.1,0.1,0.1));
scene.addLight(light);
let sphere = Sphere(P(0.0,0.0,0.0), 1.0, material);
let sphere_node = Node(sphere);
scene.addNode(sphere_node);
for i in 0..6 {
let sphere = Sphere(P(0.0,0.0,0.0), 2.0, material);
let sphere_node = Node(sphere);
sphere_node.translate(V(2.0*cos(i.to_float()), -4.0, 2.0*sin(i.to_float())));
scene.addNode(sphere_node);
}
// let child = sphere_node.child(sphere);
// child.translate(V(1.0,1.0,1.0));
// scene.addNode(sphere_node);
// scene.addNode(child);
//scene.addNode(child);
// let cube = CubeUnit(material);
// let cube_node = Node(cube);
@@ -24,10 +37,10 @@ let sphere_node = Node(sphere);
// let gnonom_node = Node(gnonom);
// scene.addNode(gnonom_node);
let cylinder = Cylinder(1.0,1.0, material);
let cylinder_node = Node(cylinder);
cylinder_node.scale(V(4.0,0.3,0.3));
cylinder_node.translate(V(0.0,-4.0,1.0));
scene.addNode(cylinder_node);
// let cylinder = Cylinder(10.0,1.0, material);
// let cylinder_node = Node(cylinder);
// //cylinder_node.scale(V(4.0,0.3,0.3));
// cylinder_node.translate(V(0.0,-4.0,0.0));
// scene.addNode(cylinder_node);
scene