Changeset 3895 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer
- Timestamp:
- Apr 19, 2005, 6:56:16 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r3894 r3895 441 441 \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture 442 442 */ 443 bool Model::addFace(int faceElemCount, inttype, ...)443 bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...) 444 444 { 445 445 if (this->currentGroup->faceCount > 0) … … 833 833 */ 834 834 835 this->addFace (4, 3, 1,1,1, 2,2,2, 4,4,3, 3,3,4);836 this->addFace (4, 3, 3,3,5, 4,4,6, 6,6,7, 5,5,8);837 this->addFace (4, 3, 5,5,9, 6,6,10, 8,8,11, 7,7,12);838 this->addFace (4, 3, 7,7,13, 8,8,14, 2,10,15, 1,9,16);839 this->addFace (4, 3, 2,2,17, 8,11,18, 6,12,19, 4,4,20);840 this->addFace (4, 3, 7,13,21, 1,1,22, 3,3,23, 5,14,24);841 842 } 835 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,1, 2,2,2, 4,4,3, 3,3,4); 836 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,3,5, 4,4,6, 6,6,7, 5,5,8); 837 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,5,9, 6,6,10, 8,8,11, 7,7,12); 838 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,7,13, 8,8,14, 2,10,15, 1,9,16); 839 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,17, 8,11,18, 6,12,19, 4,4,20); 840 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,13,21, 1,1,22, 3,3,23, 5,14,24); 841 842 } -
orxonox/trunk/src/lib/graphics/importer/model.h
r3894 r3895 23 23 VERTEX_NORMAL = NORMAL, 24 24 VERTEX_TEXCOORD = TEXCOORD, 25 VERTEX T_TEXTURE_NORMAL = NORMAL | TEXCOORD};25 VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD}; 26 26 27 27 //! Class that handles 3D-Models. it can also read them in and display them. … … 105 105 bool addVertex(float x, float y, float z); 106 106 bool addFace(char* faceString); 107 bool addFace(int faceElemCount, inttype, ...);107 bool addFace(int faceElemCount, VERTEX_FORMAT type, ...); 108 108 bool addVertexNormal(char* normalString); 109 109 bool addVertexNormal(float x, float y, float z); -
orxonox/trunk/src/lib/graphics/importer/primitive_model.cc
r3684 r3895 123 123 { 124 124 v1 = vertexCount+1; 125 this->addFace(3, TEXCOORD, v1, v1, v3, v3, v4, v4);125 this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4); 126 126 } 127 127 else if (j == detail) 128 128 { 129 129 v3 = vertexCount+2; 130 this->addFace(3, TEXCOORD, v1, v1, v2, v2, v3, v3);130 this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3); 131 131 } 132 132 else 133 this->addFace(4, TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);133 this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4); 134 134 } 135 135 } … … 167 167 p4 = 2*i+3; 168 168 // something is wrong here 169 this->addFace(4, 0, p1, p2, p3, p4);170 this->addFace(3, 0, p4, p1, 2*detail+1);171 this->addFace(3, 0, p2, p3, 2*detail+2);172 } 173 addFace(4, 0, 2*detail-1, 2*detail, 2, 1);174 this->addFace(3, VERTEX , 1, 2*detail-1, 2*detail+1);175 this->addFace(3, VERTEX , 2*detail, 2, 2*detail+2);169 this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4); 170 this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail+1); 171 this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+2); 172 } 173 addFace(4, VERTEX_ONLY, 2*detail-1, 2*detail, 2, 1); 174 this->addFace(3, VERTEX_ONLY, 1, 2*detail-1, 2*detail+1); 175 this->addFace(3, VERTEX_ONLY, 2*detail, 2, 2*detail+2); 176 176 } 177 177 … … 207 207 else 208 208 v2 = i+4; 209 this->addFace(3, VERTEX , 1, v1, v2);210 this->addFace(3, VERTEX , 2, v1, v2);209 this->addFace(3, VERTEX_ONLY, 1, v1, v2); 210 this->addFace(3, VERTEX_ONLY, 2, v1, v2); 211 211 } 212 212 } … … 238 238 v3 = (i+1)*detail + (j+1); 239 239 v4 = i*detail + (j+1); 240 this->addFace(4, TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);240 this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4); 241 241 } 242 242 }
Note: See TracChangeset
for help on using the changeset viewer.