Changeset 4357 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer
- Timestamp:
- May 28, 2005, 12:05:46 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/material.cc
r4136 r4357 83 83 84 84 // setting the transparency 85 /* 85 86 if (this->transparency < 1.0) 86 87 { … … 94 95 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 95 96 } 96 97 */ 97 98 98 99 // setting illumination Model -
orxonox/trunk/src/lib/graphics/importer/md2Model.cc
r4284 r4357 221 221 { 222 222 glNormal3fv(anorms[this->data->pLightNormals[pCommands[2]]]); 223 glTexCoord2f( ((float *)pCommands)[0], 1.0-((float *)pCommands)[1] );223 glTexCoord2f( ((float *)pCommands)[0], ((float *)pCommands)[1] ); 224 224 glVertex3fv(verticesList[pCommands[2]]); 225 225 } -
orxonox/trunk/src/lib/graphics/importer/model.cc
r4112 r4357 489 489 If a vertexTextureCoordinate line is found, 490 490 this function will inject it into the vertexTexture-Array 491 492 !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !! 491 493 */ 492 494 bool Model::addVertexTexture (const char* vTextureString) … … 497 499 PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2); 498 500 this->vTexture->addEntry(subbuffer1); 499 this->vTexture->addEntry( subbuffer2);501 this->vTexture->addEntry(1 - subbuffer2); 500 502 this->texCoordCount++; 501 503 return true; -
orxonox/trunk/src/lib/graphics/importer/texture.cc
r3966 r4357 18 18 #include "texture.h" 19 19 20 #include "debug.h" 20 21 #include "graphics_engine.h" 22 23 #include <SDL_image.h> 21 24 22 25 /** … … 167 170 168 171 GLubyte* pixels = (GLubyte*)tmpSurf->pixels; 169 170 /* this swaps the Mapping so lowel left will be upper left */171 for( int i = 0 ; i < (tmpSurf->h / 2) ; ++i )172 for( int j = 0 ; j < tmpSurf->w * tmpSurf->format->BytesPerPixel; j += tmpSurf->format->BytesPerPixel )173 for(int k = 0; k < tmpSurf->format->BytesPerPixel; ++k)174 swap( pixels[(i * tmpSurf->w * tmpSurf->format->BytesPerPixel) + j + k],175 pixels[ ( (tmpSurf->h - i - 1) * tmpSurf->w * tmpSurf->format->BytesPerPixel) + j + k]);176 172 177 173 PRINTF(3)("loading Image %s\n", imageName); -
orxonox/trunk/src/lib/graphics/importer/texture.h
r3966 r4357 14 14 #include "debug.h" 15 15 16 #include <SDL_image.h> 16 enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, 17 TEXTURE_NOISE }; 17 18 18 19 //! A Class, that reads in Textures from different fileformats. … … 27 28 public: 28 29 Texture(const char* imageName = NULL); 30 Texture(TEXTURE_TYPE type, int resolution); 29 31 ~Texture(void); 30 32
Note: See TracChangeset
for help on using the changeset viewer.