// For the test scenes, resolution of 100x100, and fov 90 degree, my // generator creates the test images. My ray dirs are normalized. //Hard code resolution for now #define RES 100 #define _USE_MATH_DEFINES //This enables math constants in Windows #include //Math functions and some constants //TODO: add any other includes you need; possibilities: // ObjLoader // GenVector // Buffer // RayGenerator // Ray // Camera // simplePNG //This might be helpful to convert from obj vectors to GenVectors Vector3 objToGenVec(obj_vector const * objVec) { Vector3 v; v[0] = objVec->e[0]; v[1] = objVec->e[1]; v[2] = objVec->e[2]; return v; } int main(int argc, char ** argv) { //TODO: create a frame buffer for RESxRES //Need at least two arguments (obj input and png output) if(argc < 3) { printf("Usage %s input.obj output.png\n", argv[0]); exit(0); } //TODO: load obj from file argv1 //TODO: create a camera object RayGenerator generator = RayGenerator(camera, RES, RES); //Convert vectors to RGB colors for testing results for(int y=0; y