Last active
February 8, 2016 22:35
-
-
Save subdavis/dbbabaf59c4ab8f4701b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _____ _______ _____ ______ _____ __ __ ______ | |
| | __ \ |__ __| | __ \| ____| /\ | __ \| \/ | ____| | |
| | |__) |__ _ _ _ | |_ __ __ _ ___ ___ _ __ | |__) | |__ / \ | | | | \ / | |__ | |
| | _ // _" | | | | | | '__/ _" |/ __/ _ \ '__| | _ /| __| / /\ \ | | | | |\/| | __| | |
| | | \ \ (_| | |_| | | | | | (_| | (_| __/ | | | \ \| |____ / ____ \| |__| | | | | |____ | |
| |_| \_\__,_|\__, | |_|_| \__,_|\___\___|_| |_| \_\______/_/ \_\_____/|_| |_|______| | |
| __/ | | |
| |___/ Written by Brandon Davis with C++ and the g++ compiler | |
| . . . . . . . . . . . . . . . . . . . . ================ Compile Instructions ================ | |
| . . . . . . . . . . . . . . . . . . . . | |
| . . . . . . . . . . . . . . . . . . . . + unzip this archive | |
| . . . . . . . . █ █ █ █ . . . . . . . . + open a terminal and cd to the source directory | |
| . . . . . . . █ █ █ █ █ █ . . . . . . . + run "./build.sh" | |
| _ _ _ █ █ █ _ █ █ █ █ █ █ _ █ █ █ _ _ _ + run "./run.sh" | |
| _ _ _ █ █ █ _ █ █ █ █ █ █ _ █ █ █ _ _ _ + images will be located in ./Images | |
| _ _ _ _ _ _ _ █ █ █ █ █ █ _ _ _ _ _ _ _ | |
| _ _ _ _ _ _ _ _ █ █ █ █ _ _ _ _ _ _ _ _ | |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
| ======================================== Build Requirements ===================================== | |
| | | |
| | + Any OS capable of running a BASH script | |
| | + The g++ compiler | |
| | * Can be installed on ubuntu-based systems via "sudo apt-get install build-essential" | |
| | + An image viewer that supports the .ppm format | |
| | * Alternatively, use imagemagick to create a .png from the .ppm output | |
| | * "sudo apt-get install imagemagick" | |
| | * "cd Images" | |
| | * "convert <ppm image name> <png image name>" | |
| | + OpenGL is NOT required. | |
| | | |
| ======================================= Description of Parts ==================================== | |
| | | |
| | This project is build from a few basic components: | |
| | + A room, which contains: | |
| | * Drawables: these implement an intersect function and a getOrtho, which returns an orthogonal ray for any point in space. | |
| | - Sphere | |
| | - Plane | |
| | - Each drawable has a PhongProp - Phong properties that the tracer will use to compute lighting | |
| | * A camera: a point in threespace to make the origin of each ray. | |
| | * Any number of lights, each of which will be computed spearately in the trace function. | |
| | * A View window: Can be set to any 3 coplanar points in space. The room will generate initial camera rays based on the camera and view window | |
| | + The Tracer, which only implements perspective tracing but could be easily refactored to allow for orthographic tracing. | |
| | * Tracer logic: check if a camera ray has any intersections, then compute lighting for the closest intersect point it finds. | |
| | + The Renderer, which encapsulates antialiasing and image resolution. | |
| | * The same room can be passed twice to the same tracer with different renderers to get either | |
| | - Different resolutions | |
| | - A different representation of the room (i.e. the ASCII preview you see) | |
| | + Helper Classes such as | |
| | * Color: normalized at the end of rendering based on the global min and max | |
| | * Vector3: used for both vectors and points | |
| | * Ray: Which wraps a vector and a point together, and is the basic unit for checking intersection | |
| | | |
| ================================================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment