-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracer.cpp
More file actions
59 lines (46 loc) · 1.15 KB
/
tracer.cpp
File metadata and controls
59 lines (46 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//Nicholas Gardner
//cs371
//Project - Ray Tracer
#include <fstream>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include "scene.h"
#include "vector.h"
#include "object.h"
#include "parser.h"
#include "fimage.h"
#define uint unsigned int
using namespace std;
unsigned int *state;
class fimage;
int main(int argc, char *argv[])
{
if (argc < 2) {
printf("Usage: './project <scene file name> <options>'\n");
return 1;
}
Scene sc;
Parser Parse;
Parse.parse(&sc, argv[1]);
for (int i = 2; i < argc; i++) {
if (argv[i][0] == '-' && argv[i][1] == 'p'){
sc.superSample = 1;
sc.softShadows = 0;
sc.recursion = 0;
sc.occlusion = 0;
} else if (argv[i][0] == '-' && argv[i][1] == 'w'){
sc.superSample = 2;
sc.softShadows = 0;
sc.recursion = 6;
sc.occlusion = 0;
sc.setRes(600,400,256,1);
} else if (argv[i][0] == '-' && argv[i][1] == 'o'){
strcpy(sc.image.fileName,argv[i+1]);
}
}
sc.drawScene();
sc.image.save();
return 0;
}