Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4357 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
May 28, 2005, 12:05:46 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now Textures are maped as they should
before this textures where switched upside-down, now this is done in the corresponding model's textureCoordinate

Location:
orxonox/trunk/src/lib/graphics
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/material.cc

    r4136 r4357  
    8383 
    8484  // setting the transparency
     85  /*
    8586  if (this->transparency < 1.0)
    8687    {
     
    9495      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    9596    }
    96 
     97  */
    9798
    9899  // setting illumination Model
  • orxonox/trunk/src/lib/graphics/importer/md2Model.cc

    r4284 r4357  
    221221        {
    222222          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] );
    224224          glVertex3fv(verticesList[pCommands[2]]);
    225225        }
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r4112 r4357  
    489489   If a vertexTextureCoordinate line is found,
    490490   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 !!
    491493*/
    492494bool Model::addVertexTexture (const char* vTextureString)
     
    497499  PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
    498500  this->vTexture->addEntry(subbuffer1);
    499   this->vTexture->addEntry(subbuffer2);
     501  this->vTexture->addEntry(1 - subbuffer2);
    500502  this->texCoordCount++;
    501503  return true;
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r3966 r4357  
    1818#include "texture.h"
    1919
     20#include "debug.h"
    2021#include "graphics_engine.h"
     22
     23#include <SDL_image.h>
    2124
    2225/**
     
    167170
    168171          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]);
    176172
    177173          PRINTF(3)("loading Image %s\n", imageName);
  • orxonox/trunk/src/lib/graphics/importer/texture.h

    r3966 r4357  
    1414#include "debug.h"
    1515
    16 #include <SDL_image.h>
     16enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS,
     17                    TEXTURE_NOISE };
    1718
    1819//! A Class, that reads in Textures from different fileformats.
     
    2728 public:
    2829  Texture(const char* imageName = NULL);
     30  Texture(TEXTURE_TYPE type, int resolution);
    2931  ~Texture(void);
    3032
  • orxonox/trunk/src/lib/graphics/particles/particle_system.cc

    r4349 r4357  
    321321    case PARTICLE_SPRITE:
    322322      glMatrixMode(GL_MODELVIEW);
    323       glDisable(GL_DEPTH_TEST);
     323      //      glDisable(GL_DEPTH_TEST);
    324324
    325325      material->select();
    326       //      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     326      //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    327327     
    328328
Note: See TracChangeset for help on using the changeset viewer.