- Timestamp:
- Nov 8, 2004, 10:37:24 PM (20 years ago)
- Location:
- orxonox/branches/importer/importer
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/importer/importer/object.cc
r2748 r2754 1 1 #include "object.h" 2 2 #include <iostream.h> 3 3 Object::Object () 4 4 { 5 this->readFromObjFile ("test"); 6 5 7 listNumber = glGenLists(1); 6 8 glNewList (listNumber, GL_COMPILE); 9 10 glEnableClientState (GL_VERTEX_ARRAY); 11 glVertexPointer(3, GL_FLOAT, 0, vertices->getArray()); 7 12 8 13 glColor3f(1.0,0,0); 9 14 glBegin(GL_TRIANGLES); 10 15 16 glArrayElement(0); 17 glArrayElement(1); 18 glArrayElement(2); 19 20 21 /* 11 22 glVertex3f(0,0,0); 12 23 glVertex3f(0,1,0); 13 24 glVertex3f(1,0,0); 25 */ 14 26 glEnd(); 15 27 glEndList(); … … 21 33 22 34 } 35 36 37 38 39 bool 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 1 1 #include "windowHandler.h" 2 #include "array.h" 2 3 3 4 class Object … … 8 9 9 10 void draw(); 11 12 bool readFromObjFile (char* fileName); 10 13 11 14 12 15 private: 13 16 GLuint listNumber; 17 Array* vertices; 18 int verticesCount; 19 Array* colors; 20 14 21 22 15 23 };
Note: See TracChangeset
for help on using the changeset viewer.