Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3805 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Apr 13, 2005, 9:02:39 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: SkyBox finished

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r3803 r3805  
    333333            //      this->spawn(this->skySphere);
    334334            skyBox = new SkyBox();
     335            skyBox->setTexture("pictures/skybox", "bmp");
     336            skyBox->setParent(localCamera);
    335337            this->spawn(skyBox);
    336338
  • orxonox/trunk/src/world_entities/skybox.cc

    r3803 r3805  
    5151      this->material[i] = new Material();
    5252      this->material[i]->setIllum(3);
    53       this->material[i]->setAmbient(1.0, 1.0, 1.0);
     53      this->material[i]->setDiffuse(0.0,0.0,0.0);
     54      this->material[i]->setSpecular(0.0,0.0,0.0);
     55      this->material[i]->setAmbient(2.0, 2.0, 2.0);
    5456    }
    5557  this->setMode(PNODE_MOVEMENT);
    5658
    57 
    58 
    5959  this->setSize(1900.0);
    60   this->rebuild();
    6160}
    6261
     
    126125  this->material[4]->setDiffuseMap(front);
    127126  this->material[5]->setDiffuseMap(back);
     127
     128  this->rebuild();
    128129}
    129130
     
    135136{
    136137  this->size = size;
     138
     139  this->rebuild();
    137140}
    138141
     
    148151  model = new Model();
    149152
    150   model->addVertex (-0.5*size, -0.5*size, 0.5*size);
     153  model->addVertex (-0.5*size, -0.5*size, 0.5*size); 
    151154  model->addVertex (0.5*size, -0.5*size, 0.5*size);
    152155  model->addVertex (-0.5*size, 0.5*size, 0.5*size);
     
    159162  model->addVertexTexture (0.0, 0.0);
    160163  model->addVertexTexture (1.0, 0.0);
     164  model->addVertexTexture (1.0, 1.0);
    161165  model->addVertexTexture (0.0, 1.0);
    162   model->addVertexTexture (1.0, 1.0);
    163   model->addVertexTexture (0.0, 2.0);
    164   model->addVertexTexture (1.0, 2.0);
    165   model->addVertexTexture (0.0, 3.0);
    166   model->addVertexTexture (1.0, 3.0);
    167   model->addVertexTexture (0.0, 4.0);
    168   model->addVertexTexture (1.0, 4.0);
    169   model->addVertexTexture (2.0, 0.0);
    170   model->addVertexTexture (2.0, 1.0);
    171   model->addVertexTexture (-1.0, 0.0);
    172   model->addVertexTexture (-1.0, 1.0);
    173166
    174167  model->addVertexNormal (0.0, 0.0, 1.0);
    175   model->addVertexNormal (0.0, 0.0, 1.0);
    176   model->addVertexNormal (0.0, 0.0, 1.0);
    177   model->addVertexNormal (0.0, 0.0, 1.0);
    178   model->addVertexNormal (0.0, 1.0, 0.0);
    179   model->addVertexNormal (0.0, 1.0, 0.0);
    180   model->addVertexNormal (0.0, 1.0, 0.0);
    181168  model->addVertexNormal (0.0, 1.0, 0.0);
    182169  model->addVertexNormal (0.0, 0.0, -1.0);
    183   model->addVertexNormal (0.0, 0.0, -1.0);
    184   model->addVertexNormal (0.0, 0.0, -1.0);
    185   model->addVertexNormal (0.0, 0.0, -1.0);
    186   model->addVertexNormal (0.0, -1.0, 0.0);
    187   model->addVertexNormal (0.0, -1.0, 0.0);
    188   model->addVertexNormal (0.0, -1.0, 0.0);
    189170  model->addVertexNormal (0.0, -1.0, 0.0);
    190171  model->addVertexNormal (1.0, 0.0, 0.0);
    191   model->addVertexNormal (1.0, 0.0, 0.0);
    192   model->addVertexNormal (1.0, 0.0, 0.0);
    193   model->addVertexNormal (1.0, 0.0, 0.0);
    194   model->addVertexNormal (-1.0, 0.0, 0.0);
    195   model->addVertexNormal (-1.0, 0.0, 0.0);
    196   model->addVertexNormal (-1.0, 0.0, 0.0);
    197172  model->addVertexNormal (-1.0, 0.0, 0.0);
    198173
    199174  model->addUseMtl(material[0]);
    200   model->addFace (4, 3, 1,1,1, 2,2,2, 4,4,3, 3,3,4);
     175  model->addFace (4, 3, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top
    201176  model->addUseMtl(material[1]);
    202   model->addFace (4, 3, 3,3,5, 4,4,6, 6,6,7, 5,5,8);
     177  model->addFace (4, 3, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom
    203178  model->addUseMtl(material[2]);
    204   model->addFace (4, 3, 5,5,9, 6,6,10, 8,8,11, 7,7,12);
     179  model->addFace (4, 3, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left
    205180  model->addUseMtl(material[3]);
    206   model->addFace (4, 3, 7,7,13, 8,8,14, 2,10,15, 1,9,16);
     181  model->addFace (4, 3, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right
    207182  model->addUseMtl(material[4]);
    208   model->addFace (4, 3, 2,2,17, 8,11,18, 6,12,19, 4,4,20);
     183  model->addFace (4, 3, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front
    209184  model->addUseMtl(material[5]);
    210   model->addFace (4, 3, 7,13,21, 1,1,22, 3,3,23, 5,14,24);
     185  model->addFace (4, 3, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back
    211186 
    212187  model->finalize();
Note: See TracChangeset for help on using the changeset viewer.