Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3365 in orxonox.OLD for orxonox/trunk/src/environment.cc


Ignore:
Timestamp:
Jan 7, 2005, 1:14:33 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/parenting back to the.
merged with command:
svn merge branches/parenting trunk -r 3247:HEAD
resolved all conflicts in favor of parenting.

File:
1 edited

Legend:

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

    r3236 r3365  
    2121#include "world_entity.h"
    2222#include "vector.h"
     23#include "importer/model.h"
    2324
    2425using namespace std;
    2526
    2627
    27 //Sorry Bensch
    28 #define LEVEL_LENGTH 500
    2928
    3029Environment::Environment () : WorldEntity()
    3130{
    32 
    33   /*
    34   //Sorry Bensch: x,y = 10
    35   for (int x = 0; x < 50; x++)
    36     {
    37       for (int y = 0; y < 50; y++)
    38         {
    39           mountainTest[x][y] =0;
    40                                                  
    41         }
    42     }
    43   //Sorry Bensch: x,y = 9
    44   for (int x = 1; x < LEVEL_LENGTH; x++)
    45     {
    46       for (int y = 1; y < LEVEL_LENGTH; y++)
    47         {
    48           //mountainTest[x][y] = (float)random() / 900000000;
    49           mountainTest[x][y] = (float)(random() % 4);                                       
    50         }
    51     }
    52   */
     31  this->model = new Model("reaplow.obj");
    5332}
    5433
    5534
    5635
    57 Environment::~Environment () {}
     36Environment::~Environment ()
     37{
     38  delete this->model;
     39}
    5840
    5941void Environment::tick (float time) {}
     
    7153  float matrix[4][4];
    7254 
    73   glTranslatef(getPlacement()->r.x,getPlacement()->r.y,getPlacement()->r.z);
    74   getPlacement()->w.matrix (matrix);
    75   glMultMatrixf ((float*)matrix);
    76 
    77   glBegin(GL_TRIANGLES);
    78   glColor3f(1,0,1);
    79   glVertex3f(0,0,0.5);
    80   glVertex3f(-0.5,0,-1);
    81   glVertex3f(0.5,0,-1);
     55  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     56  //rotate
     57  this->getAbsDir ().matrix (matrix);
     58  glMultMatrixf((float*)matrix);
    8259 
    83   glVertex3f(0,0,0.5);
    84   glVertex3f(0,0.5,-1);
    85   glVertex3f(0,-0.5,-1);
    86   glEnd();
    87    
    88   glBegin(GL_QUADS);
    89   glColor3f(1,0,1);
    90   glVertex3f(0.5,0.5,-1);
    91   glVertex3f(0.5,-0.5,-1);
    92   glVertex3f(-0.5,-0.5,-1);
    93   glVertex3f(-0.5,0.5,-1);
    94   glEnd();
     60  glMatrixMode(GL_MODELVIEW);
     61  this->model->draw();
    9562}
    9663
    97 /*
    98 void Environment::paint()
    99 {
    100  
    101   glPushMatrix();
    102   //glScalef(0.5, 0.5, 1.0);
    103   //glTranslatef(xCor, yCor, zCor);
    104   glTranslatef( -16.0, -2.0, 0.0);
    105  
    106   glColor3f(0.0, 1.0, 0.0);
    107  
    108   glBegin(GL_LINES);
    109   for (int x = 0; x < LEVEL_LENGTH; x += 1)
    110     {
    111       for (int y = 0; y < 190; y += 1)
    112         {
    113           glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
    114           glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]);
    115         }
    116     }
    117   glEnd();
    118  
    119  
    120   glBegin(GL_LINES);
    121   for (int y = 0; y < LEVEL_LENGTH; y += 1)
    122     {
    123       for (int x = 0; x < 90; x += 1)
    124         {
    125           glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
    126           glVertex3f((float)(2*(x+1)), (float)(2*y), mountainTest[x+1][y]);
    127         }
    128     }
    129   glEnd();
    130  
    131   glPopMatrix();
    132  
    133 }
    134 
    135 void Environment::drawEnvironment()
    136 {
    137 
    138 }
    139 
    140 */
Note: See TracChangeset for help on using the changeset viewer.