Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3323 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jan 3, 2005, 2:21:34 PM (20 years ago)
Author:
patrick
Message:

oroxnox/branches/parenting: turned coordinate system, now using the normal opengl orientation: x: forth, y: up, z: right. tried to turn the landscape, but didnt work. will be remade later

Location:
orxonox/branches/parenting/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/camera.cc

    r3307 r3323  
    178178          //world->calcCameraPos (&lookat, &desiredPlace);
    179179          //FIXME: camera should be made via relative coordinates
    180           Vector* cameraOffset = new Vector (-10, 0, 5);
     180          Vector* cameraOffset = new Vector (-10, 5, 0);
    181181          this->setRelCoor (cameraOffset);
    182182        }
     
    247247  gluLookAt(this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z,
    248248            this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z,
    249             0.0, 0.0, 1.0);
     249            0.0, 1.0, 0.0);
    250250 
    251251
  • orxonox/branches/parenting/src/player.cc

    r3309 r3323  
    136136  Vector direction (1.0, 0.0, 0.0);
    137137  //direction = this->absDirection.apply (direction);
    138   Vector orthDirection (0.0, 1.0, 0.0);
     138  Vector orthDirection (0.0, 0.0, 1.0);
    139139  //orthDirection = orthDirection.cross (direction);
    140140
  • orxonox/branches/parenting/src/world.cc

    r3321 r3323  
    272272
    273273  int sizeX = 100;
    274   int sizeY = 80;
     274  int sizeZ = 80;
    275275  float length = 1000;
    276276  float width = 200;
    277277  float widthX = float (length /sizeX);
    278   float widthY = float (width /sizeY);
    279  
    280   float height [sizeX][sizeY];
    281   Vector normal_vectors[sizeX][sizeY];
     278  float widthZ = float (width /sizeZ);
     279 
     280  float height [sizeX][sizeZ];
     281  Vector normal_vectors[sizeX][sizeZ];
    282282 
    283283 
    284284  for ( int i = 0; i<sizeX-1; i+=1)
    285     for (int j = 0; j<sizeY-1;j+=1)
     285    for (int j = 0; j<sizeZ-1;j+=1)
    286286      //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
    287287#ifdef __WIN32__
     
    291291#endif
    292292
    293   //Die Hügel ein wenig glätten
     293  //Die Huegel ein wenig glaetten
    294294  for (int h=1; h<2;h++)
    295295    for (int i=1;i<sizeX-2 ;i+=1 )
    296       for(int j=1;j<sizeY-2;j+=1)
     296      for(int j=1;j<sizeZ-2;j+=1)
    297297        height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
    298298 
    299299  //Berechnung von normalen Vektoren
    300  
    301300  for(int i=1;i<sizeX-2;i+=1)
    302     for(int j=1;j<sizeY-2 ;j+=1)
     301    for(int j=1;j<sizeZ-2 ;j+=1)
    303302      {
    304         Vector v1 = Vector (widthX*(1),      widthY*(j)  ,      height[i][j]);
    305         Vector v2 = Vector (widthX*(i-1),    widthY*(j)  ,      height[i-1][j]);
    306         Vector v3 = Vector (widthX*(i),      widthY*(j+1),      height[i][j+1]);
    307         Vector v4 = Vector (widthX*(i+1),    widthY*(j),        height[i+1][j]);
    308         Vector v5 = Vector (widthX*(i),      widthY*(j-1),      height[i][j-1]);
     303        Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
     304        Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
     305        Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
     306        Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
     307        Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
    309308       
    310309        Vector c1 = v2 - v1;
     
    319318  int snowheight=3;
    320319  for ( int i = 0; i<sizeX; i+=1)
    321     for (int j = 0; j<sizeY;j+=1)
     320    for (int j = 0; j<sizeZ;j+=1)
    322321      {   
    323         Vector v1 = Vector (widthX*(i),      widthY*(j)  -width/2,      height[i][j]-20 );
    324         Vector v2 = Vector (widthX*(i+1),    widthY*(j)  -width/2,      height[i+1][j]-20);
    325         Vector v3 = Vector (widthX*(i+1),    widthY*(j+1)-width/2,    height[i+1][j+1]-20);
    326         Vector v4 = Vector (widthX*(i),      widthY*(j+1)-width/2,    height[i][j+1]-20);
     322        Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
     323        Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
     324        Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
     325        Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
    327326        float a[3];
    328327        if(height[i][j]<snowheight){
Note: See TracChangeset for help on using the changeset viewer.