Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3895 in orxonox.OLD for orxonox/trunk/src/lib


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

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

Location:
orxonox/trunk/src/lib/graphics/importer
Files:
3 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}
Note: See TracChangeset for help on using the changeset viewer.