Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3895 in orxonox.OLD


Ignore:
Timestamp:
Apr 19, 2005, 6:56:16 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more logic in adding face with the numerical adder

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r3894 r3895  
    441441   \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture
    442442*/
    443 bool Model::addFace(int faceElemCount, int type, ...)
     443bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)
    444444{
    445445   if (this->currentGroup->faceCount > 0)
     
    833833  */
    834834
    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  
    2323                    VERTEX_NORMAL = NORMAL,
    2424                    VERTEX_TEXCOORD = TEXCOORD,
    25                     VERTEXT_TEXTURE_NORMAL = NORMAL | TEXCOORD};
     25                    VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};
    2626
    2727//! Class that handles 3D-Models. it can also read them in and display them.
     
    105105  bool addVertex(float x, float y, float z);
    106106  bool addFace(char* faceString);
    107   bool addFace(int faceElemCount, int type, ...);
     107  bool addFace(int faceElemCount, VERTEX_FORMAT type, ...);
    108108  bool addVertexNormal(char* normalString);
    109109  bool addVertexNormal(float x, float y, float z);
  • orxonox/trunk/src/lib/graphics/importer/primitive_model.cc

    r3684 r3895  
    123123            {
    124124              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);
    126126            }
    127127          else if (j == detail)
    128128            {
    129129              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);
    131131            }
    132132          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);
    134134        }
    135135    }
     
    167167      p4 = 2*i+3;
    168168      // 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);
    176176}
    177177
     
    207207      else
    208208        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);
    211211    }
    212212}
     
    238238        v3 = (i+1)*detail + (j+1);
    239239        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);
    241241      }
    242242}
  • orxonox/trunk/src/world_entities/skybox.cc

    r3807 r3895  
    188188
    189189  model->addUseMtl(material[0]);
    190   model->addFace (4, 3, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top
     190  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top
    191191  model->addUseMtl(material[1]);
    192   model->addFace (4, 3, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom
     192  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom
    193193  model->addUseMtl(material[2]);
    194   model->addFace (4, 3, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left
     194  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left
    195195  model->addUseMtl(material[3]);
    196   model->addFace (4, 3, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right
     196  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right
    197197  model->addUseMtl(material[4]);
    198   model->addFace (4, 3, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front
     198  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front
    199199  model->addUseMtl(material[5]);
    200   model->addFace (4, 3, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back
     200  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back
    201201 
    202202  model->finalize();
Note: See TracChangeset for help on using the changeset viewer.