Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2821 in orxonox.OLD for orxonox/trunk/importer


Ignore:
Timestamp:
Nov 12, 2004, 1:20:47 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: added BOX if no Object can be displayed

Location:
orxonox/trunk/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.cc

    r2820 r2821  
    3939      return false;
    4040    }
     41  vertices = new Array();
     42  normals = new Array();
     43  vTexture = new Array();
     44
    4145  glNewList (listNumber, GL_COMPILE);
    4246  glEnableClientState (GL_VERTEX_ARRAY);
     
    5155  if (verbose >=3)
    5256    printf("finalizing the 3D-Object\n");
     57  OBJ_FILE->close();
     58  glEnd();
    5359  glEndList();
    5460  return true;
     
    6975    {
    7076      if (verbose >=1)
    71         printf ("unable to open .OBJ file: %s\n", fileName);
     77        printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
     78      BoxObject();
    7279      return false;
    7380    }
    7481  objFileName = fileName;
    7582  char Buffer[500];
    76   vertices = new Array();
    77   normals = new Array();
    78   vTexture = new Array();
    7983  while(!OBJ_FILE->eof())
    8084    {
     
    123127
    124128 
    125   OBJ_FILE->close();
    126   glEnd();
    127129 
    128130}
     
    307309
    308310
     311void Object::BoxObject(void)
     312{
     313  readVertex ("-0.500000 -0.500000 0.500000");
     314  readVertex ("0.500000 -0.500000 0.500000");
     315  readVertex ("-0.500000 0.500000 0.500000");
     316  readVertex ("0.500000 0.500000 0.500000");
     317  readVertex ("-0.500000 0.500000 -0.500000");
     318  readVertex ("0.500000 0.500000 -0.500000");
     319  readVertex ("-0.500000 -0.500000 -0.500000");
     320  readVertex ("0.500000 -0.500000 -0.500000");
     321  readVertexTexture ("0.000000 0.000000");
     322  readVertexTexture ("1.000000 0.000000");
     323  readVertexTexture ("0.000000 1.000000");
     324  readVertexTexture ("1.000000 1.000000");
     325  readVertexTexture ("0.000000 2.000000");
     326  readVertexTexture ("1.000000 2.000000");
     327  readVertexTexture ("0.000000 3.000000");
     328  readVertexTexture ("1.000000 3.000000");
     329  readVertexTexture ("0.000000 4.000000");
     330  readVertexTexture ("1.000000 4.000000");
     331  readVertexTexture ("2.000000 0.000000");
     332  readVertexTexture ("2.000000 1.000000");
     333  readVertexTexture ("-1.000000 0.000000");
     334  readVertexTexture ("-1.000000 1.000000");
     335 
     336  readVertexNormal ("0.000000 0.000000 1.000000");
     337  readVertexNormal ("0.000000 0.000000 1.000000");
     338  readVertexNormal ("0.000000 0.000000 1.000000");
     339  readVertexNormal ("0.000000 0.000000 1.000000");
     340  readVertexNormal ("0.000000 1.000000 0.000000");
     341  readVertexNormal ("0.000000 1.000000 0.000000");
     342  readVertexNormal ("0.000000 1.000000 0.000000");
     343  readVertexNormal ("0.000000 1.000000 0.000000");
     344  readVertexNormal ("0.000000 0.000000 -1.000000");
     345  readVertexNormal ("0.000000 0.000000 -1.000000");
     346  readVertexNormal ("0.000000 0.000000 -1.000000");
     347  readVertexNormal ("0.000000 0.000000 -1.000000");
     348  readVertexNormal ("0.000000 -1.000000 0.000000");
     349  readVertexNormal ("0.000000 -1.000000 0.000000");
     350  readVertexNormal ("0.000000 -1.000000 0.000000");
     351  readVertexNormal ("0.000000 -1.000000 0.000000");
     352  readVertexNormal ("1.000000 0.000000 0.000000");
     353  readVertexNormal ("1.000000 0.000000 0.000000");
     354  readVertexNormal ("1.000000 0.000000 0.000000");
     355  readVertexNormal ("1.000000 0.000000 0.000000");
     356  readVertexNormal ("-1.000000 0.000000 0.000000");
     357  readVertexNormal ("-1.000000 0.000000 0.000000");
     358  readVertexNormal ("-1.000000 0.000000 0.000000");
     359  readVertexNormal ("-1.000000 0.000000 0.000000");
     360
     361  readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
     362  readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
     363  readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
     364  readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
     365  readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
     366  readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
     367}
  • orxonox/trunk/importer/object.h

    r2820 r2821  
    5151
    5252  bool addGLElement (char* elementString);
     53
     54  void BoxObject (void);
    5355};
    5456
Note: See TracChangeset for help on using the changeset viewer.