1 #ifndef __BRAIN_3DOBJECT 2 #define __BRAIN_3DOBJECT 3 4 class C3DObject { 5 public: 6 C3DObject(); 7 C3DObject(char *file,char *texturedir); /* Contruir a partir de un fichero */ 8 ~C3DObject(); 9 10 void refresh_display_lists(void); 11 12 bool loadASC(char *file); 13 bool loadASE(char *file,char *texturedir); 14 15 bool valid(void); 16 void draw(void); 17 void draw(float r,float g,float b); 18 void draw_notexture(float r,float g,float b); 19 void draw_notexture(float r,float g,float b,float a); 20 21 void drawcmc(float r,float g,float b); 22 23 void CalculaNormales(int *smooth); 24 25 float normalize(void); /* Sets the maximum axis size to 1.0 or -1.0 */ 26 float normalize(float c); /* Sets the maximum axis size to c or -c */ 27 float normalizexy(float c); /* Sets the maximum X and Y axis size to c or -c */ 28 void makepositive(void); /* Sets the minimum coordinates to 0,0,0 */ 29 void makepositivex(void); /* Sets the minimum coordinates in X axis to 0 */ 30 void makepositivey(void); /* Sets the minimum coordinates in Y axis to 0 */ 31 void makepositivez(void); /* Sets the minimum coordinates in Z axis to 0 */ 32 void moveobject(float x,float y,float z); 33 34 35 int npuntos; 36 int ncaras; 37 float *puntos; 38 float *normales; 39 int *caras; 40 41 float *r,*g,*b; /* Color de las caras: */ 42 43 int display_list; 44 45 CMC cmc; 46 47 float *tx,*ty; 48 unsigned int *textures; 49 }; 50 51 #endif 52