Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3526 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Mar 13, 2005, 8:00:25 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better ModelView-matrix transformations

Location:
orxonox/trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/environment.cc

    r3484 r3526  
    5050{
    5151  glMatrixMode(GL_MODELVIEW);
    52   glLoadIdentity();
     52  glPushMatrix();
    5353  float matrix[4][4];
    5454 
     
    5959 
    6060  this->model->draw();
     61
     62  glPopMatrix();
    6163}
    6264
  • orxonox/trunk/src/world_entities/player.cc

    r3484 r3526  
    2929Player::Player(bool isFree) : WorldEntity(isFree)
    3030{
    31 
    3231  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   */
    5832}
    5933
     
    137111{
    138112  glMatrixMode(GL_MODELVIEW);
    139   glLoadIdentity();
     113  glPushMatrix();
    140114  float matrix[4][4];
    141115 
     
    148122  glMultMatrixf((float*)matrix);
    149123 
    150   glMatrixMode(GL_MODELVIEW);
    151124  this->model->draw();
    152   // glCallList(objectList);
     125  glPopMatrix();
    153126}
    154127
  • orxonox/trunk/src/world_entities/primitive.cc

    r3524 r3526  
    5555{
    5656  glMatrixMode(GL_MODELVIEW);
    57   glLoadIdentity();
     57  glPushMatrix();
    5858  float matrix[4][4];
    5959 
     
    6464 
    6565  this->model->draw();
     66  glPopMatrix();
    6667}
    6768
  • orxonox/trunk/src/world_entities/skysphere.cc

    r3507 r3526  
    9999{
    100100  glEnable(GL_TEXTURE_2D);
    101   skyMaterial->select();
    102101  glPushMatrix();
     102  glMatrixMode(GL_MODELVIEW);
    103103  glTranslatef(this->absCoordinate.x,
    104104               this->absCoordinate.y,
     
    109109  //glRotatef(-250.0f, 0.0, 1.0f, 0.0f);
    110110 
     111  skyMaterial->select();
    111112  gluSphere(sphereObj, sphereRadius, 20, 20);
    112113  glPopMatrix();
Note: See TracChangeset for help on using the changeset viewer.