Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 28, 2005, 12:05:46 PM (20 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
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r4320 r4357  
    259259  backMat->select();
    260260  glBegin(GL_TRIANGLE_STRIP);
    261   glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY + imageHeight);
    262   glTexCoord2i(1, 0); glVertex2i(offsetX +imageWidth, offsetY + imageHeight);
    263   glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY);
    264   glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY);
     261  glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);
     262  glTexCoord2i(1, 1); glVertex2i(offsetX +imageWidth, offsetY + imageHeight);
     263  glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
     264  glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
    265265  glEnd();
    266266 
     
    279279  barMat->select();
    280280  glBegin(GL_TRIANGLE_STRIP);
    281   glTexCoord2f(0, 0); glVertex2i(barX, barY + barH);
    282   glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH);
    283   glTexCoord2f(0, 1); glVertex2i(barX, barY);
    284   glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY);
     281  glTexCoord2f(0,   1); glVertex2i(barX, barY + barH);
     282  glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH);
     283  glTexCoord2f(0,   0); glVertex2i(barX, barY);
     284  glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY);
    285285  glEnd();
    286286
  • 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
  • orxonox/trunk/src/subprojects/particles/particle_fun.cc

    r4356 r4357  
    100100        {
    101101          tmpEmit->setEmissionRate(atof(value));
    102           PRINT(3)("EmissionRate set to %f\n", atof(value));
     102          PRINT(4)("EmissionRate set to %f\n", atof(value));
    103103        }
    104104      else if (!strcmp(name, "Velocity"))
    105105        {
    106106          tmpEmit->setEmissionVelocity(atof(value));
    107           PRINT(3)("Velocity set to %f\n", atof(value));
     107          PRINT(4)("Velocity set to %f\n", atof(value));
    108108        }
    109109      else if(!strcmp(name, "SpreadAngle"))
    110110        {
    111111          tmpEmit->setSpread(atof(value));
    112           PRINT(3)("SpreadAngle set to %f\n", atof(value));
     112          PRINT(4)("SpreadAngle set to %f\n", atof(value));
    113113        }
    114114      else if(!strcmp(name, "EmitterType"))
     
    120120          else if (!strcmp(value, "EMITTER_CUBE"))
    121121            tmpEmit->setType(EMITTER_CUBE);
    122           PRINT(3)("EmitterType set to %s\n", value);
     122          PRINT(4)("EmitterType set to %s\n", value);
    123123        }
    124124      else if(!strcmp(name, "EmitterSize"))
    125125        {
    126126          tmpEmit->setSize(atof(value));
    127           PRINT(3)("EmitterSize set to %f\n", atof(value));
     127          PRINT(4)("EmitterSize set to %f\n", atof(value));
    128128        }
    129129    }
     
    144144        {
    145145          tmpSys->setRadius(atof(value), tmpSys->getEndRadius());
    146           PRINT(3)("ParticleStartRadius set to %f\n", atof(value));
     146          PRINT(4)("ParticleStartRadius set to %f\n", atof(value));
    147147        }
    148148      else if (!strcmp(name, "EndRadius"))
    149149        {
    150150          tmpSys->setRadius( tmpSys->getStartRadius(), atof(value));
    151           PRINT(3)("ParticleEndRadius set to %f\n", atof(value));
     151          PRINT(4)("ParticleEndRadius set to %f\n", atof(value));
    152152        }
    153153
     
    155155        {
    156156          tmpSys->setLifeSpan(atof(value));
    157           PRINT(3)("ParticleLifeSpan set to %f\n", atof(value));
     157          PRINT(4)("ParticleLifeSpan set to %f\n", atof(value));
    158158        }
    159159
     
    161161        {
    162162          tmpSys->setConserve(atof(value));
    163           PRINT(3)("ParticleConserveFactor set to %f\n", atof(value));
     163          PRINT(4)("ParticleConserveFactor set to %f\n", atof(value));
    164164        }
    165165
     
    173173            tmpSys->setType(PARTICLE_SPRITE);
    174174
    175           PRINT(3)("ParticleType set to %s\n", value);
     175          PRINT(4)("ParticleType set to %s\n", value);
    176176        }
    177177
     
    179179        {
    180180          tmpSys->setInheritSpeed(atof(value));
    181           PRINT(3)("ParticleInheritSpeed set to %f\n", atof(value));
     181          PRINT(4)("ParticleInheritSpeed set to %f\n", atof(value));
    182182        }
    183183      else if (!strcmp(name, "RandomColor"))
  • orxonox/trunk/src/world_entities/skybox.cc

    r4320 r4357  
    193193  this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size);
    194194
     195  this->skyModel->addVertexTexture (0.0, 1.0);
     196  this->skyModel->addVertexTexture (1.0, 1.0);
     197  this->skyModel->addVertexTexture (1.0, 0.0);
    195198  this->skyModel->addVertexTexture (0.0, 0.0);
    196   this->skyModel->addVertexTexture (1.0, 0.0);
    197   this->skyModel->addVertexTexture (1.0, 1.0);
    198   this->skyModel->addVertexTexture (0.0, 1.0);
    199199
    200200  this->skyModel->addVertexNormal (0.0, 0.0, 1.0);
Note: See TracChangeset for help on using the changeset viewer.