BVH and rays complete

This commit is contained in:
STP
2023-12-02 21:52:59 -05:00
parent d89e7f4951
commit d8488f24f7
9 changed files with 277 additions and 190 deletions

View File

@@ -10,18 +10,20 @@ scene.addCamera("Cam", camera);
let falloff = V(0.0,0.0,0.0);
let light = Light(P(6.0,6.0,6.0), V(0.4,0.4,0.4), falloff);
light.active(false);
light.active(true);
scene.addLight("white", light);
let light = Light(P(2.0,0.0,0.0), V(0.0,1.0,0.0), V(0.1, 0.01, 0.001));
let light = Light(P(2.0,0.0,0.0), V(1.0,1.0,0.0), falloff);
light.active(false);
scene.addLight("green", light);
let light = Light(P(-2.0,0.0,0.0), V(1.0,0.0,0.0), V(0.1, 0.01, 0.001));
let light = Light(P(-2.0,0.0,0.0), V(1.0,0.0,0.0), falloff);
light.active(false);
scene.addLight("red", light);
let light = Ambient(V(0.3,0.3,0.3));
light.active(false);
scene.addLight("ambient", light);
let tri = TriangleUnit();
let tri_node = Node(tri, material);
tri_node.active(false);
@@ -39,7 +41,7 @@ scene.addNode("cone", cone_node);
let torus = Torus(0.5, 1.5);
let torus_node = Node(torus, material);
torus_node.active(true);
torus_node.active(false);
scene.addNode("torus", torus_node);
@@ -59,7 +61,8 @@ scene.addNode("ground", ground_node);
let mesh = Mesh("obj/cat.obj");
let mesh_node = Node(mesh, material);
mesh_node.active(false);
mesh_node.active(true);
mesh_node.rotate(0.0,90.0,90.0);
scene.addNode("mesh", mesh_node);