Allegro - otexturovanie kocky zvnutra
Created: 2008-11-11 - 17:33
#include #include #include "upjsGl.h" #include using namespace std; struct BOD{ float x,y,z; }; struct STENA{ int v[4]; }; vector stena; vector bod; int n, m; //pocet vrcholov, stien int nacitaj(char* subor) { FILE *s; s = fopen(subor, "r"); if (s == 0) return 1; fscanf(s, "%d", &n); for (int i=0; i = 0; j--) { glTexCoord2f(tu[j], tv[j]); glVertex3f(bod[stena[i].v[j]].x, bod[stena[i].v[j]].y, bod[stena[i].v[j]].z); } glEnd(); } allegro_gl_flip(); if(key[KEY_ESC]) break; if(key[KEY_RIGHT]){ glRotatef(1,0,-1,0); } if(key[KEY_LEFT]){ glRotatef(1,0,1,0); } if(key[KEY_UP]){ glRotatef(1,1,0,0); } if(key[KEY_DOWN]){ glRotatef(1,-1,0,0); } } allegro_gl_end(); readkey(); upjsGl_exit(); return 0; } END_OF_MAIN();