- Timestamp:
- Dec 1, 2005, 11:12:28 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.h
r5405 r5866 51 51 static void addTexturePath(const char* pathName); 52 52 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. 60 60 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. 64 64 }; 65 65 #endif -
trunk/src/subprojects/importer/multitex.cc
r5865 r5866 33 33 TextureSequence* seq; 34 34 Texture* test; 35 Material* testMat; 36 35 37 float counter = 0; 38 36 39 37 40 void Framework::moduleInit(int argc, char** argv) 38 41 { 39 42 ResourceManager::getInstance()->addImageDir("./"); 43 44 testMat = new Material; 40 45 41 46 seq = new TextureSequence(); … … 46 51 } 47 52 test = new Texture(argv[1]); 53 testMat->setDiffuseMap(argv[1]); 48 54 49 55 ResourceManager::getInstance()->addImageDir(""); 50 56 51 57 52 obj = new PrimitiveModel(PRIM_ CYLINDER);58 obj = new PrimitiveModel(PRIM_SPHERE, 10.0); 53 59 54 60 ResourceManager::getInstance()->debug(); … … 84 90 void Framework::moduleDraw(void) const 85 91 { 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(); 104 93 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 113 94 obj->draw(); 114 95
Note: See TracChangeset
for help on using the changeset viewer.