diff --git a/.gitignore b/.gitignore index 26b9e06..60aa2c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ *.bmp *.png -*.out \ No newline at end of file +*.out + + +!/renders/*.png \ No newline at end of file diff --git a/README.md b/README.md index d53ca61..1312fd8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Raymarching in C +![infinite spheres](renders/spheres.png) + ## Compiling: ```fish diff --git a/main.c b/main.c index be0861d..2d3ecbc 100644 --- a/main.c +++ b/main.c @@ -43,7 +43,9 @@ int main(int argc, char* argv[]) { int threads = 1; Camera cam; cam.fov = 90; - camera_set_looking_at(&cam, pt_new(0,0,0), pt_new(1,1,1)); + + float cam_position = 0; + camera_set_looking_at(&cam, pt_new(cam_position,cam_position,cam_position), pt_new(1,1,1)); if (argc > 1) { threads = atoi(argv[1]); @@ -53,10 +55,10 @@ int main(int argc, char* argv[]) { // create basic scene with up to 10 objects Scene scene = scene_new(1920, 1080, 10); - scene.max_steps = 256; + scene.max_steps = 300; scene.threshold = 0.02; - scene_add_obj(&scene, circle_new(pt_new(1,1,1), .2)); + scene_add_obj(&scene, circle_new(pt_new(SCENE_MOD / 2.0, SCENE_MOD/ 2.0, SCENE_MOD / 2.0), .2)); //scene_add_obj(&scene, circle_new(pt_new(0,2,0), 0.5)); //scene_add_obj(&scene, circle_new(pt_new(0,-2,0), 0.5)); diff --git a/march.out b/march.out deleted file mode 100755 index 21d7c3c..0000000 Binary files a/march.out and /dev/null differ diff --git a/renders/spheres.png b/renders/spheres.png new file mode 100644 index 0000000..63ea296 Binary files /dev/null and b/renders/spheres.png differ