#ifndef CG_HEIGHTFIELD_H #define CG_HEIGHTFIELD_H #include "util.h" #include "cgapplication.h" #include // Ray Tracer Class class CGRayTracer : public CGApplication { public: // CGRayTracer, ~CGRayTracer CGRayTracer(unsigned int x, unsigned int y); virtual ~CGRayTracer(); virtual void onInit(); virtual void onDraw(); virtual void onIdle(); virtual void onKey(unsigned char key); virtual void onSize(unsigned int newWidth, unsigned int newHeight); // createImage void createImage(int width, int height); void writeImage(char* fileName); // use shadows bool shadows_; // max recursion depth int maxDepth_; int nTests_; private: // phongIlluminationColor Color phongIlluminationColor( const Vector& point, const Vector& normal, Material* material); // writePPMPixel void writePPMPixel(const Color& c); // rayTrace Color rayTrace(const Ray& r, int nDepth=1); // add an object to the scene void AddObject(Shape* shape, Material* material); // shape and material array int shapeSize_; Shape** shape_; Material** material_; // light array int lightSize_; Light** light_; // camera Camera* camera_; // dimension of viewport int width_; int height_; // memory buffer unsigned int imagex_, imagey_; Color* image_; int detail_; bool antialias_; // file ofstream* out_; // timer clock_t start_; }; #endif // CG_HeightField_H