#include #include #include #include #include #include #include "vec.h" #include "scene.h" #define DEBUG using namespace std; void mkppm(vector< vector > A, string fname) { ofstream out(fname.c_str()); #ifdef DEBUG cout << "P3 " << A[0].size() << " " << A.size() << " 255" << endl; #endif out << "P3 " << A[0].size() << " " << A.size() << " 255" << endl; for (int i=0; i> 16) << " "<< ((A[i][j] >> 8) & 255) << " " << (A[i][j] & 255) << " "; out << endl; } out.close(); } void asciiDump(vector< vector > A) { for (int i=0; i 0) cout << "*"; else cout << " "; } cout << endl; } } int main(int argc, char **argv) { if (argc < 4) { cout << "Usage " << argv[0] << " " << endl; exit(1); } int w = atoi(argv[1]); int h = atoi(argv[2]); string scn(argv[3]); // make the scene Scene sc(scn); // setup the view vector > A(h, vector(w,0) ); double factor = (double)h/(2.0*tan(60*3.14159/360.0)); for (int i=0; i