- Timestamp:
- Jan 18, 2006, 12:38:19 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/grid.h
r6518 r6519 28 28 29 29 float& height(unsigned int row, unsigned int column) { return this->vertex(row*this->_columns + column).y;}; 30 Vector& vertexG(unsigned int row, unsigned int column) { return this->vertex(row*this->_columns + column); }; 31 Vector& normalG(unsigned int row, unsigned int column) { return this->normal(row*this->_columns + column); }; 30 32 31 33 -
trunk/src/lib/graphics/importer/vertex_array_model.cc
r6477 r6519 137 137 PRINTF(4)("drawing 3D-VertexArrayModel %s\n", this->getName()); 138 138 glEnableClientState(GL_VERTEX_ARRAY ); 139 //glEnableClientState(GL_TEXTURE_COORD_ARRAY );139 glEnableClientState(GL_TEXTURE_COORD_ARRAY ); 140 140 glEnableClientState(GL_NORMAL_ARRAY ); 141 141 glEnableClientState(GL_COLOR_ARRAY ); … … 144 144 glVertexPointer(3, GL_FLOAT, 0, &this->vertices[0]); 145 145 glNormalPointer(GL_FLOAT, 0, &this->normals[0]); 146 //glTexCoordPointer(2, GL_FLOAT, 0, &this->texCoords[0]);146 glTexCoordPointer(2, GL_FLOAT, 0, &this->texCoords[0]); 147 147 glColorPointer(3, GL_FLOAT, 0, &this->colors[0]); 148 148 -
trunk/src/world_entities/environments/water.cc
r6518 r6519 46 46 this->velocities = NULL; 47 47 this->viscosity = 5; 48 this->cohesion = .0000 2;48 this->cohesion = .00000001; 49 49 50 50 if (root != NULL) … … 55 55 this->waterShader = (Shader*)ResourceManager::getInstance()->load("shaders/water.vert", SHADER, RP_GAME, (void*)"shaders/water.frag"); 56 56 57 this->grid->height(this->grid->columns()/2,this->grid->rows()/2) = 100 0;57 this->grid->height(this->grid->columns()/2,this->grid->rows()/2) = 100; 58 58 } 59 59 … … 185 185 186 186 // calc normals 187 /* float l[3]; 188 float m[3]; 189 for(j = 1; j < _width-1; j++) { 190 for(i = 1; i < _width - 1; i++) { 191 l[0] = _map[i][j-1].u[0] - _map[i][j+1].u[0]; 192 l[1] = _map[i][j-1].u[1] - _map[i][j+1].u[1]; 193 l[2] = _map[i][j-1].u[2] - _map[i][j+1].u[2]; 194 m[0] = _map[i-1][j].u[0] - _map[i+1][j].u[0]; 195 m[1] = _map[i-1][j].u[1] - _map[i+1][j].u[1]; 196 m[2] = _map[i-1][j].u[2] - _map[i+1][j].u[2]; 197 _map[i][j].n[0] = l[1]*m[2]-l[2]*m[1]; 198 _map[i][j].n[1] = l[2]*m[0]-l[0]*m[2]; 199 _map[i][j].n[2] = l[0]*m[1]-l[1]*m[0]; 200 } 201 }*/ 202 } 187 // float l[3]; 188 // float m[3]; 189 // for(j = 1; j < this->grid->rows() -1; j++) { 190 // for(i = 1; i < this->grid->columns() - 1; i++) { 191 // l[0] = this->grid->vertexG(i, j-1).x - this->grid->vertexG(i, j+1).x; 192 // l[1] = this->grid->vertexG(i, j-1).y - this->grid->vertexG(i, j+1).y; 193 // l[2] = this->grid->vertexG(i, j-1).z - this->grid->vertexG(i, j+1).z; 194 // m[0] = this->grid->vertexG(i-1,j).x - this->grid->vertexG(i+1, j).x; 195 // m[1] = this->grid->vertexG(i-1,j).y - this->grid->vertexG(i+1, j).y; 196 // m[2] = this->grid->vertexG(i-1,j).z - this->grid->vertexG(i+1, j).z; 197 // this->grid->normalG(i, j).x = l[1] * m[2] - l[2] * m[1]; 198 // this->grid->normalG(i, j).y = l[2] * m[0] - l[0] * m[2]; 199 // this->grid->normalG(i, j).z = l[0] * m[1] - l[1] * m[0]; 200 // } 201 // } 202 this->grid->rebuildNormals(this->height); 203 } -
trunk/src/world_entities/skybox.cc
r6512 r6519 81 81 this->material[i]->setAmbient(2.0, 2.0, 2.0); 82 82 83 this-> texture[i] = NULL;83 this->cubeTexture[i] = NULL; 84 84 } 85 85 this->setParentMode(PNODE_MOVEMENT); … … 166 166 const char* right, const char* front, const char* back) 167 167 { 168 this-> texture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB);169 this-> texture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB);170 this-> texture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);171 this-> texture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB);172 this-> texture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB);173 this-> texture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB);168 this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB); 169 this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB); 170 this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB); 171 this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB); 172 this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB); 173 this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB); 174 174 } 175 175 … … 177 177 { 178 178 glEnable(GL_TEXTURE_CUBE_MAP_ARB); 179 glEnable(GL_TEXTURE_2D); 179 180 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); 180 181 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); … … 188 189 { 189 190 glDisable(GL_TEXTURE_CUBE_MAP_ARB); 191 glDisable(GL_TEXTURE_2D); 190 192 glDisable(GL_TEXTURE_GEN_S); 191 193 glDisable(GL_TEXTURE_GEN_T); -
trunk/src/world_entities/skybox.h
r6512 r6519 57 57 58 58 Material* material[6]; //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back 59 Texture* texture[6];//!< Textures for the CubeMap.59 Texture* cubeTexture[6]; //!< Textures for the CubeMap. 60 60 61 61 float size; //!< Size of the SkyBox. This should match the frustum maximum range.
Note: See TracChangeset
for help on using the changeset viewer.