Changeset 3728 in orxonox.OLD for orxonox/branches
- Timestamp:
- Apr 5, 2005, 9:53:42 PM (20 years ago)
- Location:
- orxonox/branches/shadows/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/shadows/src/Makefile.in
r3698 r3728 1 # Makefile.in generated by automake 1.8. 5from Makefile.am.1 # Makefile.in generated by automake 1.8.3 from Makefile.am. 2 2 # @configure_input@ 3 3 … … 572 572 tags=; \ 573 573 here=`pwd`; \ 574 if ( $(ETAGS)--etags-include --version) >/dev/null 2>&1; then \574 if (etags --etags-include --version) >/dev/null 2>&1; then \ 575 575 include_option=--etags-include; \ 576 empty_fix=.; \577 576 else \ 578 577 include_option=--include; \ 579 empty_fix=; \580 578 fi; \ 581 579 list='$(SUBDIRS)'; for subdir in $$list; do \ 582 580 if test "$$subdir" = .; then :; else \ 583 test ! -f $$subdir/TAGS ||\581 test -f $$subdir/TAGS && \ 584 582 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ 585 583 fi; \ … … 591 589 $(AWK) ' { files[$$0] = 1; } \ 592 590 END { for (i in files) print i; }'`; \ 593 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 594 test -n "$$unique" || unique=$$empty_fix; \ 595 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 596 $$tags $$unique; \ 597 fi 591 test -z "$(ETAGS_ARGS)$$tags$$unique" \ 592 || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 593 $$tags $$unique 598 594 ctags: CTAGS 599 595 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -
orxonox/branches/shadows/src/console/Makefile.in
r3698 r3728 1 # Makefile.in generated by automake 1.8. 5from Makefile.am.1 # Makefile.in generated by automake 1.8.3 from Makefile.am. 2 2 # @configure_input@ 3 3 … … 289 289 $(AWK) ' { files[$$0] = 1; } \ 290 290 END { for (i in files) print i; }'`; \ 291 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 292 test -n "$$unique" || unique=$$empty_fix; \ 293 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 294 $$tags $$unique; \ 295 fi 291 test -z "$(ETAGS_ARGS)$$tags$$unique" \ 292 || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 293 $$tags $$unique 296 294 ctags: CTAGS 297 295 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -
orxonox/branches/shadows/src/gui/Makefile.in
r3698 r3728 1 # Makefile.in generated by automake 1.8. 5from Makefile.am.1 # Makefile.in generated by automake 1.8.3 from Makefile.am. 2 2 # @configure_input@ 3 3 … … 321 321 $(AWK) ' { files[$$0] = 1; } \ 322 322 END { for (i in files) print i; }'`; \ 323 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 324 test -n "$$unique" || unique=$$empty_fix; \ 325 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 326 $$tags $$unique; \ 327 fi 323 test -z "$(ETAGS_ARGS)$$tags$$unique" \ 324 || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 325 $$tags $$unique 328 326 ctags: CTAGS 329 327 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -
orxonox/branches/shadows/src/importer/Makefile.in
r3698 r3728 1 # Makefile.in generated by automake 1.8. 5from Makefile.am.1 # Makefile.in generated by automake 1.8.3 from Makefile.am. 2 2 # @configure_input@ 3 3 … … 306 306 $(AWK) ' { files[$$0] = 1; } \ 307 307 END { for (i in files) print i; }'`; \ 308 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 309 test -n "$$unique" || unique=$$empty_fix; \ 310 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 311 $$tags $$unique; \ 312 fi 308 test -z "$(ETAGS_ARGS)$$tags$$unique" \ 309 || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 310 $$tags $$unique 313 311 ctags: CTAGS 314 312 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -
orxonox/branches/shadows/src/orxonox.cc
r3706 r3728 133 133 134 134 int bpp = 16; 135 int width = 1024;136 int height = 768;135 int width = 400; 136 int height = 300; 137 137 //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/ 138 138 //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER; -
orxonox/branches/shadows/src/shadow.cc
r3712 r3728 29 29 #include <math.h> 30 30 #include "shadow.h" 31 #include "vector.h" 32 31 33 32 34 #define SIZE 128 … … 39 41 */ 40 42 41 Shadow::Shadow(OBJModel* player,Player* playerangle ,float groundVertexes[])43 Shadow::Shadow(OBJModel* player,Player* playerangle) 42 44 { 43 45 this->player=player; … … 101 103 void Shadow::createShadow() 102 104 { 103 glViewport(0,0, 2*SIZE,2*SIZE);104 glScissor(0,0, 2*SIZE,2*SIZE);105 glViewport(0,0,SIZE,SIZE); 106 glScissor(0,0,SIZE,SIZE); 105 107 glEnable(GL_SCISSOR_TEST); 106 108 glBindTexture(GL_TEXTURE_2D,this->shadow_id); … … 133 135 134 136 glDisable(GL_SCISSOR_TEST); 135 glViewport(0,0, 1024,768); //Achtung: hier Aufloesung von Orxonox einstellen!137 glViewport(0,0,400,300); //Achtung: hier Aufloesung von Orxonox einstellen! 136 138 137 139 … … 159 161 160 162 163 } 164 165 /** 166 brief takes the ground data from the world.cc class and passes it to shadow.cc 167 168 */ 169 170 void Shadow::setGround() 171 { 172 this->ground_id=glGenLists(1); 173 glNewList(this->ground_id,GL_COMPILE); 174 glBegin(GL_QUADS); 175 for(int i=0;i<100;i+=1) 176 for(int j=0;j<80;j+=1) 177 { 178 glNormal3f(normal_vectors[i][j].x,normal_vectors[i][j].y,normal_vectors[i][j].z); 179 glTexCoord2f(0.0f,0.0f); 180 glVertex3f(vertexes[0][i][j].x,vertexes[0][i][j].y,vertexes[0][i][j].z); 181 glNormal3f(normal_vectors[i+1][j].x,normal_vectors[i+1][j].y,normal_vectors[i+1][j].z); 182 glTexCoord2f(1.0f,0.0f); 183 glVertex3f(vertexes[1][i][j].x,vertexes[1][i][j].y,vertexes[1][i][j].z); 184 glNormal3f(normal_vectors[i+1][j+1].x,normal_vectors[i+1][j+1].y,normal_vectors[i+1][j+1].z); 185 glTexCoord2f(1.0f,1.0f); 186 glVertex3f(vertexes[2][i][j].x,vertexes[2][i][j].y,vertexes[2][i][j].z); 187 glNormal3f(normal_vectors[i][j+1].x,normal_vectors[i][j+1].y,normal_vectors[i][j+1].z); 188 glTexCoord2f(0.0f,1.0f); 189 glVertex3f(vertexes[3][i][j].x,vertexes[3][i][j].y,vertexes[3][i][j].z); 190 } 191 glEnd(); 192 glEndList(); 193 194 195 196 } 197 198 void Shadow::setNormal(Vector a,int i,int j) 199 { 200 normal_vectors[i][j]=a; 201 202 } 203 204 void Shadow::setVertexNum(Vector a,int i,int j,int num) 205 { 206 vertexes[num][i][j]=a; 207 161 208 } 162 209 /** … … 209 256 createShadow(); 210 257 211 / *glClearColor(0,0,0,0);212 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);213 glMatrixMode(GL_PROJECTION);214 glLoadIdentity();215 gluPerspective(45,4.0/3.0,.5,100);216 glMatrixMode(GL_MODELVIEW);217 glLoadIdentity();218 219 gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);220 */258 //glClearColor(0,0,0,0); 259 //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 260 //glMatrixMode(GL_PROJECTION); 261 //glLoadIdentity(); 262 //gluPerspective(45,4.0/3.0,.5,100); 263 //glMatrixMode(GL_MODELVIEW); 264 //glLoadIdentity(); 265 266 //gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1); 267 221 268 glEnable(GL_TEXTURE_GEN_S); 222 269 glEnable(GL_TEXTURE_GEN_T); … … 228 275 glLoadIdentity(); 229 276 glTranslatef(0.5,0.5,1.0); 277 glScalef(0.5,0.5,1.0); 230 278 glOrtho(-1,1,-1,1,-1,1); 231 279 … … 237 285 glEnable(GL_BLEND); 238 286 glBlendFunc(GL_DST_COLOR,GL_SRC_COLOR); 239 glCallList( ground_id);287 glCallList(this->ground_id); 240 288 glDisable(GL_BLEND); 241 289 -
orxonox/branches/shadows/src/shadow.h
r3706 r3728 23 23 #include "world_entity.h" 24 24 #include "player.h" 25 #include "vector.h" 25 26 26 27 //! A Class to handle the Shadow … … 36 37 unsigned char *image; 37 38 OBJModel* player; 39 Vector normal_vectors[100][80]; 40 Vector vertexes[4][100][80]; 38 41 //playerangle used to obtain information about the angle of the player 39 42 Player* playerangle; … … 43 46 void m_inverse(const float *m,float *out); 44 47 48 45 49 46 50 public: 47 Shadow(OBJModel* player,Player* playerangle ,float groundVertexes[]);51 Shadow(OBJModel* player,Player* playerangle); 48 52 ~Shadow(); 49 53 void init(); 50 54 void draw(); 55 void setGround(); 56 void setNormal(Vector a,int i,int j); 57 void setVertexNum(Vector a,int i,int j,int num); 51 58 void updatePosition(float x,float y,float z); 52 59 -
orxonox/branches/shadows/src/world.cc
r3706 r3728 44 44 this->debugWorldNr = -1; 45 45 this->entities = new tList<WorldEntity>(); 46 46 47 } 47 48 … … 291 292 292 293 //create shadow 293 float a[]={1.0,1.0,1.0,4.0};294 this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer ,a);294 295 this->shadow =new Shadow(myPlayer->model,(Player*)myPlayer); 295 296 shadow->init(); 296 297 … … 406 407 407 408 408 glBegin(GL_QUADS);409 409 410 410 411 … … 419 420 float height [sizeX][sizeZ]; 420 421 Vector normal_vectors[sizeX][sizeZ]; 422 Vector vertexes[sizeX][sizeZ]; 423 424 glBegin(GL_QUADS); 421 425 422 426 … … 453 457 normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4); 454 458 normal_vectors[i][j].normalize(); 459 shadow->setNormal(normal_vectors[i][j],i,j); 455 460 } 456 461 … … 468 473 a[2]=1.0; 469 474 glMaterialfv(GL_FRONT,GL_DIFFUSE,a); 475 shadow->setVertexNum(v1,i,j,0); 476 shadow->setVertexNum(v2,i,j,1); 477 shadow->setVertexNum(v3,i,j,2); 478 shadow->setVertexNum(v4,i,j,3); 479 480 481 470 482 471 483 glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z); … … 473 485 //glTexCoord2f((float)i/(float)sizeX,(float)j/(float)sizeZ); 474 486 glVertex3f(v1.x, v1.y, v1.z); 475 476 487 477 488 glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z); … … 492 503 } 493 504 glEnd(); 505 shadow->setGround(); 494 506 495 507 // Disable Textures Again, for Performance reasons.
Note: See TracChangeset
for help on using the changeset viewer.