Changeset 3526 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 13, 2005, 8:00:25 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r3449 r3526 173 173 // SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); 174 174 175 // OpenGL stuff176 glClearColor (0.0, 0.0, 0.0, 0.0);177 glEnable (GL_DEPTH_TEST);178 179 175 return 0; 180 176 } -
orxonox/trunk/src/story_entities/world.cc
r3522 r3526 41 41 World::World (char* name) 42 42 { 43 this->setClassName ("World"); 44 this->worldName = name; 45 this->debugWorldNr = -1; 46 this->entities = new tList<WorldEntity>(); 43 this->init(name, -1); 47 44 } 48 45 … … 53 50 World::World (int worldID) 54 51 { 55 this->debugWorldNr = worldID; 56 this->worldName = NULL; 57 this->entities = new tList<WorldEntity>(); 52 this->init(NULL, worldID); 58 53 } 59 54 … … 94 89 /* this->localPlayer hasn't to be deleted explicitly, it is 95 90 contained in entities*/ 91 } 92 93 /** 94 \brief initializes a new World 95 */ 96 void World::init(char* name, int worldID) 97 { 98 this->setClassName ("World"); 99 100 this->worldName = name; 101 this->debugWorldNr = worldID; 102 this->entities = new tList<WorldEntity>(); 103 104 // Enable default GL stuff 105 glEnable(GL_DEPTH_TEST); 106 96 107 } 97 108 … … 289 300 objectList = glGenLists(1); 290 301 glNewList (objectList, GL_COMPILE); 291 glLoadIdentity(); 302 292 303 glColor3f(1.0,0,0); 293 glBegin(GL_QUADS);294 304 295 305 int sizeX = 100; … … 338 348 } 339 349 350 glBegin(GL_QUADS); 340 351 int snowheight=3; 341 352 for ( int i = 0; i<sizeX; i+=1) … … 410 421 } 411 422 glEnd(); 412 /*413 glBegin(GL_LINES);414 for( float x = -128.0; x < 128.0; x += 25.0)415 {416 for( float y = -128.0; y < 128.0; y += 25.0)417 {418 glColor3f(1,0,0);419 glVertex3f(x,y,-128.0);420 glVertex3f(x,y,0.0);421 glColor3f(0.5,0,0);422 glVertex3f(x,y,0.0);423 glVertex3f(x,y,128.0);424 }425 }426 for( float y = -128.0; y < 128.0; y += 25.0)427 {428 for( float z = -128.0; z < 128.0; z += 25.0)429 {430 glColor3f(0,1,0);431 glVertex3f(-128.0,y,z);432 glVertex3f(0.0,y,z);433 glColor3f(0,0.5,0);434 glVertex3f(0.0,y,z);435 glVertex3f(128.0,y,z);436 }437 }438 for( float x = -128.0; x < 128.0; x += 25.0)439 {440 for( float z = -128.0; z < 128.0; z += 25.0)441 {442 glColor3f(0,0,1);443 glVertex3f(x,-128.0,z);444 glVertex3f(x,0.0,z);445 glColor3f(0,0,0.5);446 glVertex3f(x,0.0,z);447 glVertex3f(x,128.0,z);448 }449 450 }451 */452 /*453 glBegin(GL_LINE_STRIP);454 glColor3f(1.0, 5.0, 1.0);455 for( int i = 0; i <= 30; i++)456 {457 glEvalCoord1f ((GLfloat) i/30.0);458 }459 glEnd();460 */461 423 462 424 trackManager->drawGraph(.01); 463 425 trackManager->debug(2); 464 /*465 glBegin(GL_LINES);466 float i;467 for(i = 0.0; i<1; i+=.01)468 {469 printf("%f, %f, %f\n",tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);470 glVertex3f(tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);471 }472 glEnd();473 */474 426 glEndList(); 427 428 475 429 // LIGHT initialisation 476 430 light = Light::getInstance(); … … 635 589 /* draw entities */ 636 590 WorldEntity* entity; 591 glLoadIdentity(); 592 637 593 entity = this->entities->enumerate(); 638 594 while( entity != NULL ) -
orxonox/trunk/src/story_entities/world.h
r3521 r3526 57 57 58 58 private: 59 void init(char* name, int worldID); 60 59 61 Uint32 lastFrame; //!< last time of frame 60 62 bool bQuitOrxonox; //!< quit this application -
orxonox/trunk/src/world_entities/environment.cc
r3484 r3526 50 50 { 51 51 glMatrixMode(GL_MODELVIEW); 52 gl LoadIdentity();52 glPushMatrix(); 53 53 float matrix[4][4]; 54 54 … … 59 59 60 60 this->model->draw(); 61 62 glPopMatrix(); 61 63 } 62 64 -
orxonox/trunk/src/world_entities/player.cc
r3484 r3526 29 29 Player::Player(bool isFree) : WorldEntity(isFree) 30 30 { 31 32 31 this->model = new OBJModel("../data/models/reaplow.obj"); 33 /*34 objectList = glGenLists(1);35 glNewList (objectList, GL_COMPILE);36 37 glBegin(GL_TRIANGLES);38 glColor3f(1,1,1);39 glVertex3f(0,0,0.5);40 glVertex3f(-0.5,0,-1);41 glVertex3f(0.5,0,-1);42 43 glVertex3f(0,0,0.5);44 glVertex3f(0,0.5,-1);45 glVertex3f(0,-0.5,-1);46 glEnd();47 48 glBegin(GL_QUADS);49 glColor3f(0,0,1);50 glVertex3f(0.5,0.5,-1);51 glVertex3f(0.5,-0.5,-1);52 glVertex3f(-0.5,-0.5,-1);53 glVertex3f(-0.5,0.5,-1);54 glEnd();55 56 glEndList ();57 */58 32 } 59 33 … … 137 111 { 138 112 glMatrixMode(GL_MODELVIEW); 139 gl LoadIdentity();113 glPushMatrix(); 140 114 float matrix[4][4]; 141 115 … … 148 122 glMultMatrixf((float*)matrix); 149 123 150 glMatrixMode(GL_MODELVIEW);151 124 this->model->draw(); 152 // glCallList(objectList);125 glPopMatrix(); 153 126 } 154 127 -
orxonox/trunk/src/world_entities/primitive.cc
r3524 r3526 55 55 { 56 56 glMatrixMode(GL_MODELVIEW); 57 gl LoadIdentity();57 glPushMatrix(); 58 58 float matrix[4][4]; 59 59 … … 64 64 65 65 this->model->draw(); 66 glPopMatrix(); 66 67 } 67 68 -
orxonox/trunk/src/world_entities/skysphere.cc
r3507 r3526 99 99 { 100 100 glEnable(GL_TEXTURE_2D); 101 skyMaterial->select();102 101 glPushMatrix(); 102 glMatrixMode(GL_MODELVIEW); 103 103 glTranslatef(this->absCoordinate.x, 104 104 this->absCoordinate.y, … … 109 109 //glRotatef(-250.0f, 0.0, 1.0f, 0.0f); 110 110 111 skyMaterial->select(); 111 112 gluSphere(sphereObj, sphereRadius, 20, 20); 112 113 glPopMatrix();
Note: See TracChangeset
for help on using the changeset viewer.