00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef ROUNDEDCUBE_H
00019 #define ROUNDEDCUBE_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <GL/glut.h>
00026 #include <math.h>
00027
00039 class RoundedCube {
00040
00041 private:
00042 float side_length;
00043 float round_width;
00044 int round_steps;
00045
00046 void CopyColor(float a[], float b[]);
00047 void RotateColors(int a, int b, int c, int d);
00048
00049 void MakeCornerSphere();
00050 void MakeRoundedSide();
00051 void DrawMarker();
00052 void DrawArrow(float x1, float y1, float z1,
00053 float x2, float y2, float z2);
00054
00055 float sides[6][3];
00056 float sides_specular[4];
00057 float sides_shininess[1];
00058 float bevel_diffuse[4];
00059 float bevel_specular[4];
00060 float bevel_shininess[1];
00061
00062 public:
00064 enum axis { Xaxis, Yaxis, Zaxis };
00065
00068 bool draw_normals;
00069
00081 RoundedCube(float s_length = 0.8, float r_width = 0.1, int r_steps = 2);
00082
00085 void render();
00086
00097 void rotate(axis a, bool direction);
00098
00099 };
00100
00101 #endif