Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2768 in orxonox.OLD for orxonox/branches/importer


Ignore:
Timestamp:
Nov 9, 2004, 5:31:28 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/importer: works again for everything. added methode addGLElement

Location:
orxonox/branches/importer/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/importer/importer/framework.cc

    r2765 r2768  
    99void DrawGLScene()
    1010{
    11   rotator +=.01;
     11  rotator +=.001;
    1212 
    1313  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
     
    1717  glLoadIdentity();     
    1818  gluPerspective(45.0f,500/375,0.1f,100.0f);
    19   gluLookAt (10*sin(rotator),15,10*cos(rotator), 0,0,0, 0,1,0);
     19  gluLookAt (5*sin(rotator),7.5,5*cos(rotator), 0,0,0, 0,1,0);
    2020 
    2121  obj->draw();
  • orxonox/branches/importer/importer/object.cc

    r2767 r2768  
    55  initialize();
    66
    7   importFile ("sphere.obj");
     7  importFile ("reaphigh.obj");
    88 
    99
     
    9898{
    9999  readVertices = true;
    100   char subbuffer1[10];
    101   char subbuffer2[10];
    102   char subbuffer3[10];
     100  char subbuffer1[20];
     101  char subbuffer2[20];
     102  char subbuffer3[20];
    103103  sscanf (vertexString, "%s %s %s", subbuffer1, subbuffer2, subbuffer3);
    104104  vertices->addEntry(atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));
     
    115115
    116116  readVertices = false;
    117   char subbuffer1[10];
    118   char subbuffer2[10];
    119   char subbuffer3[10];
    120   char subbuffer4[10] ="";
     117  char subbuffer1[20];
     118  char subbuffer2[20];
     119  char subbuffer3[20];
     120  char subbuffer4[20] ="";
    121121  sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
    122122  //      vertices->addEntry(atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));
     
    132132      faceMode = 3;
    133133      //printf ("triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3);
    134       glArrayElement(atoi(subbuffer1));
    135       glArrayElement(atoi(subbuffer2));
    136       glArrayElement(atoi(subbuffer3));
    137 
     134      addGLElement(subbuffer1);
     135      addGLElement(subbuffer2);
     136      addGLElement(subbuffer3);
    138137      return true;
    139138    }
     
    147146        }
    148147      faceMode = 4;
    149       //printf ("quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
    150       glArrayElement(atoi(subbuffer1));
    151       glArrayElement(atoi(subbuffer2));
    152       glArrayElement(atoi(subbuffer3));
    153       glArrayElement(atoi(subbuffer4));
     148      printf ("quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
     149      addGLElement(subbuffer1);
     150      addGLElement(subbuffer2);
     151      addGLElement(subbuffer3);
     152      addGLElement(subbuffer4);
    154153      return true;
    155154    }
    156155}
     156
     157bool Object::addGLElement (char* elementString)
     158{
     159  char* pointTo;
     160  pointTo = strstr (elementString, "/");
     161  pointTo[0] = '\0';
     162  printf ("f: %s\n", elementString);
     163  glArrayElement(atoi(elementString)-1);
     164
     165}
  • orxonox/branches/importer/importer/object.h

    r2767 r2768  
    3535  bool readVT (char* vtString);
    3636
     37  bool addGLElement (char* elementString);
    3738};
Note: See TracChangeset for help on using the changeset viewer.