Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2754 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Nov 8, 2004, 10:37:24 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/importer: added array-class, that handles input dynamic arrays. Made a fake file read routine

Location:
orxonox/branches/importer/importer
Files:
2 added
2 edited

Legend:

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

    r2748 r2754  
    11#include "object.h"
    2 
     2#include <iostream.h>
    33Object::Object ()
    44{
     5  this->readFromObjFile ("test");
     6   
    57  listNumber = glGenLists(1);
    68  glNewList (listNumber, GL_COMPILE);
     9
     10  glEnableClientState (GL_VERTEX_ARRAY);
     11  glVertexPointer(3, GL_FLOAT, 0, vertices->getArray());
    712 
    813  glColor3f(1.0,0,0);
    914  glBegin(GL_TRIANGLES);
    1015 
     16  glArrayElement(0);
     17  glArrayElement(1);
     18  glArrayElement(2);
     19 
     20
     21  /* 
    1122  glVertex3f(0,0,0); 
    1223  glVertex3f(0,1,0);
    1324  glVertex3f(1,0,0);
     25  */
    1426  glEnd();
    1527  glEndList();
     
    2133
    2234}
     35
     36
     37
     38
     39bool Object::readFromObjFile (char* fileName)
     40{
     41  vertices = new Array(2000);
     42  vertices->addEntry(0,0,0);
     43  vertices->addEntry(0,1,0);
     44  vertices->addEntry(1,0,1);
     45  vertices->finalizeArray();
     46 
     47 
     48
     49  return true;
     50}
  • orxonox/branches/importer/importer/object.h

    r2748 r2754  
    11#include "windowHandler.h"
     2#include "array.h"
    23
    34class Object
     
    89 
    910  void draw();
     11 
     12  bool readFromObjFile (char* fileName);
    1013
    1114
    1215 private:
    1316  GLuint listNumber;
     17  Array* vertices;
     18  int verticesCount;
     19  Array* colors;
     20
    1421 
     22
    1523};
Note: See TracChangeset for help on using the changeset viewer.