Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5866 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Dec 1, 2005, 11:12:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: multi-texture work perfectly, try building src/subprojects/importer/multitex
and
execute
./multitex [fileName[ fileName [fileName […]]]]

Location:
trunk/src
Files:
2 edited

Legend:

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

    r5405 r5866  
    5151  static void addTexturePath(const char* pathName);
    5252
    53  private:
    54   int         illumModel;       //!< The IlluminationModel is either flat or smooth.
    55   float       diffuse [4];      //!< The diffuse color of the Material.
    56   float       ambient [4];      //!< The ambient color of the Material.
    57   float       specular [4];     //!< The specular color of the Material.
    58   float       shininess;        //!< The shininess of the Material.
    59   float       transparency;     //!< The transperency of the Material.
     53  private:
     54    int         illumModel;       //!< The IlluminationModel is either flat or smooth.
     55    float       diffuse [4];      //!< The diffuse color of the Material.
     56    float       ambient [4];      //!< The ambient color of the Material.
     57    float       specular [4];     //!< The specular color of the Material.
     58    float       shininess;        //!< The shininess of the Material.
     59    float       transparency;     //!< The transperency of the Material.
    6060  public:
    61   Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
    62   Texture*    ambientTexture;   //!< The ambient texture of the Material.
    63   Texture*    specularTexture;  //!< The specular texture of the Material.
     61    Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
     62    Texture*    ambientTexture;   //!< The ambient texture of the Material.
     63    Texture*    specularTexture;  //!< The specular texture of the Material.
    6464};
    6565#endif
  • trunk/src/subprojects/importer/multitex.cc

    r5865 r5866  
    3333TextureSequence* seq;
    3434Texture* test;
     35Material* testMat;
     36
    3537float counter = 0;
     38
    3639
    3740void Framework::moduleInit(int argc, char** argv)
    3841{
    3942  ResourceManager::getInstance()->addImageDir("./");
     43
     44  testMat = new Material;
    4045
    4146  seq = new TextureSequence();
     
    4651  }
    4752  test = new Texture(argv[1]);
     53  testMat->setDiffuseMap(argv[1]);
    4854
    4955  ResourceManager::getInstance()->addImageDir("");
    5056
    5157
    52   obj = new PrimitiveModel(PRIM_CYLINDER);
     58  obj = new PrimitiveModel(PRIM_SPHERE, 10.0);
    5359
    5460  ResourceManager::getInstance()->debug();
     
    8490void Framework::moduleDraw(void) const
    8591{
    86   float diffuse[] = {1,1,1,1};
    87   float ambient[] = {1,0,0,1};
    88   float specular[] = {1,0,1,1};
    89   // setting diffuse color
    90   //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
    91   glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
    92 
    93   // setting ambient color
    94   glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
    95 
    96   // setting up Sprecular
    97   glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
    98 
    99   // setting up Shininess
    100   glMaterialf(GL_FRONT, GL_SHININESS, .4);
    101   glShadeModel(GL_SMOOTH);
    102 
    103   glEnable(GL_TEXTURE_2D);
     92  testMat->select();
    10493  glBindTexture(GL_TEXTURE_2D, seq->getTexture());
    105 //  printf("Number = %d\n", seq->getTexture());
    106     /* This allows alpha blending of 2D textures with the scene */
    107 //     if (seq->hasAlpha())
    108 //     {
    109 //       glEnable(GL_BLEND);
    110 //       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    111 //     }
    112 
    11394  obj->draw();
    11495
Note: See TracChangeset for help on using the changeset viewer.