Changeset 7510 in orxonox.OLD for branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
- Timestamp:
- May 3, 2006, 2:37:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r7507 r7510 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: bottac@ee.ethz.ch … … 222 222 PRINTF(4)("BSP FILE: Texture 0: %s. \n", &this->textures[8+ 72*i]); 223 223 this->load_textures(); 224 224 225 225 // Load the lightMaps 226 226 this->glLightMapTextures = new GLuint[this->numLightMaps]; 227 227 for(int i = 0; i < this->numLightMaps; i++) 228 228 this->glLightMapTextures[i] = this->loadLightMapToGL(this->lightMaps[i]); 229 229 230 230 //Create white texture for if no lightmap specified 231 231 glGenTextures(1, &this->whiteLightMap); 232 232 glBindTexture(GL_TEXTURE_2D, this->whiteLightMap); 233 233 //Create texture 234 234 this->whiteTexture[0]=255; 235 235 this->whiteTexture[1]=255; 236 236 this->whiteTexture[2]=255; 237 237 238 238 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 239 239 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT); … … 244 244 245 245 246 246 247 247 /* control the mipmap levels */ 248 248 glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5); … … 260 260 (const GLvoid *)&(this->whiteTexture)); 261 261 262 gluBuild2DMipmaps( 262 gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGBA8, 1, 1, 263 263 GL_RGB, GL_FLOAT,(const GLvoid *) &(this->whiteTexture)); 264 265 264 265 266 266 267 267 // Get the number of patches … … 324 324 float z1 =(((plane *) this->planes) [planeIndex]).z; 325 325 thisNode->leafIndex = 0; 326 thisNode->d 326 thisNode->d = (((plane *) this->planes) [planeIndex]).d; 327 327 328 328 thisNode->plane = Vector(x1,y1,z1); … … 464 464 PRINTF(0)("BSP FILE: gefunden . \n"); 465 465 this->Materials[i] =this->loadMat(fileName); 466 466 467 467 } 468 468 … … 480 480 continue; 481 481 } 482 // 482 // Default Material 483 483 this->Materials[i].mat = new Material(); 484 484 this->Materials[i].mat->setDiffuse(0.1,0.1,0.1); … … 503 503 if(this->testSurf != NULL) { 504 504 if(this->testSurf->format->Amask != 0 ) tmpAMat.alpha = true; 505 else 505 else tmpAMat.alpha = false; 506 506 } else tmpAMat.alpha = false; 507 507 … … 510 510 tmp->setAmbient(1.0,1.0,1.0 ); 511 511 tmp->setSpecular(1.0,1.0,1.0); 512 // 513 // 512 // tmp->setShininess(.5); 513 // tmp->setTransparency(1.0); 514 514 515 515 tmp->setDiffuseMap(mat); … … 539 539 scale*=255.0; 540 540 sc*=scale; 541 ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc; 542 543 541 ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc; 542 543 544 544 } 545 545 546 546 glGenTextures(1, &lightMap); 547 547 glBindTexture(GL_TEXTURE_2D, lightMap); … … 569 569 (const GLvoid *)&lightMapTexture); 570 570 571 571 572 572 // build the MipMaps automaticaly 573 573 errorCode = gluBuild2DMipmaps(GL_TEXTURE_2D, … … 579 579 (const GLvoid *)&lightMapTexture 580 580 ); 581 581 582 582 583 583 … … 715 715 716 716 717 //Vertice[u*(tesselation+1)+v]= 717 //Vertice[u*(tesselation+1)+v]= temp[0]*((1.0f-px)*(1.0f-px))+ temp[1]*((1.0f-px)*px*2)+ temp[2]*(px*px); 718 718 Vertice[u*(level1)+v].position[0]=temp[0].position[0]*((1.0f-px)*(1.0f-px))+temp[1].position[0]*((1.0f-px)*px*2)+temp[2].position[0]*(px*px); 719 719 Vertice[u*(level1)+v].position[1]=temp[0].position[1]*((1.0f-px)*(1.0f-px))+temp[1].position[1]*((1.0f-px)*px*2)+temp[2].position[1]*(px*px);
Note: See TracChangeset
for help on using the changeset viewer.