?? primitiveshapes.h
字號:
#ifndef _PRIMITIVES_
#define _PRIMITIVES_
#include "BaseShapes.h"
#include "RGBpixmap.h"
#include <windows.h>
//@$@$@$@$@$@$@$@$@$@ Plane class @$@$@$@$@$@$@$@$@$
class Plane : public Shape
{
public:
Plane();
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print();
};
class Checkerboard : public Shape
{
private:
Plane *checkObj1, *checkObj2;
double dx, dy;
public:
Checkerboard();
Checkerboard(double newDX, double newDY);
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print();
};
//@$@$@$@$@$@$@$@$@$@ Square class @$@$@$@$@$@$@$@$@$
class Square : public Shape
{
public:
Square();
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print();
};
//@$@$@$@$@$@$@$@$@ Cube class $@$@$@$@$@$@$@$@$@$@
class Cube : public Shape
{
private:
Point3 cubeNormal(int surface);
public:
Cube();
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print(void);
};
//@$@$@$@$@$@$@$@$ Sphere class @$@$@$@$@$@$@$@$@$@$@$@
class Sphere : public Shape
{
public:
Sphere();
void makeExtentPoints(PointCluster& clust);
bool hit(Ray& r, Intersection& inter);
void drawOpenGL();
void print();
};
//@$@$@$@$@$@$@$@$@$@ TaperedCylinder class @$@$@$@$@$@$@$@$@$
class TaperedCylinder : public Shape
{
public:
float smallRadius;
TaperedCylinder();
TaperedCylinder(float radius);
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print();
};
//@$@$@$@$@$@$@$@$@$@ Cone class @$@$@$@$@$@$@$@$@$
class Cone : public TaperedCylinder
{
public:
Cone();
void print();
void drawOpenGL();
};
//@$@$@$@$@$@$@$@$@$@ Cylinder class @$@$@$@$@$@$@$@$@$
class Cylinder : public TaperedCylinder
{
public:
Cylinder();
void print();
void drawOpenGL();
};
//@$@$@$@$@$@$@$@$@$@ Torus class @$@$@$@$@$@$@$@$@$
class Torus : public Shape
{
public:
Torus();
void makeExtentPoints(PointCluster& clust);
bool hit(Ray &r, Intersection &inter);
void drawOpenGL();
void print();
};
class Teapot : public Shape{
public:
Teapot(){};
void makeExtentPoints(PointCluster& clust) {};
void drawOpenGL(){ tellMaterialsGL(); glPushMatrix();
glMultMatrixf(transf.m);
glutSolidTeapot(1.0); glPopMatrix();};
bool hit(Ray &r, Intersection &inter){return false;}
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -