Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10404 in orxonox.OLD for trunk/src/world_entities/blackscreen.cc


Ignore:
Timestamp:
Jan 27, 2007, 2:20:24 PM (19 years ago)
Author:
patrick
Message:

correct fading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/blackscreen.cc

    r10403 r10404  
    2323#include "material.h"
    2424#include "state.h"
    25 #include "camera.h"
    26 #include "static_model.h"
     25// #include "camera.h"
     26#include "primitive_model.h"
    2727
    2828ObjectListDefinition(BlackScreen);
     
    7474  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    7575
    76   this->build();
     76  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10);
     77  this->setModel(model);
    7778
    7879  i=0;
     
    101102  glEnable(GL_BLEND);   // Turn Blending On
    102103
    103   glMatrixMode(GL_MODELVIEW);
    104   glPushMatrix();
    105   /* translate */
    106   glTranslatef (this->getAbsCoor ().x,
    107                 this->getAbsCoor ().y,
    108                 this->getAbsCoor ().z);
    109   Vector tmpRot = this->getAbsDir().getSpacialAxis();
    110   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     104//   glMatrixMode(GL_MODELVIEW);
     105//   glPushMatrix();
     106//   /* translate */
     107//   glTranslatef (this->getAbsCoor ().x,
     108//                 this->getAbsCoor ().y,
     109//                 this->getAbsCoor ().z);
     110//   Vector tmpRot = this->getAbsDir().getSpacialAxis();
     111//   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    111112
    112113  this->material->select();
     
    139140
    140141  this->material->setTransparency(i);
    141   Camera* cam = State::getCamera();
    142   if( cam != NULL)
    143     this->setParent(cam);
     142//   Camera* cam = State::getCamera();
     143//   if( cam != NULL)
     144//     this->setParent(cam);
    144145}
    145146
     
    188189    return 0;
    189190}
    190 
    191 
    192 void BlackScreen::build()
    193 {
    194   StaticModel* model = new StaticModel();
    195 
    196   float size = 10.;
    197 
    198   model->addVertex (-size, -size, size);
    199   model->addVertex (size, -size, size);
    200   model->addVertex (-size, size, size);
    201   model->addVertex (size, size, size);
    202   model->addVertex (-size, size, -size);
    203   model->addVertex (size, size, -size);
    204   model->addVertex (-size, -size, -size);
    205   model->addVertex (size, -size, -size);
    206 
    207 
    208   model->addVertexNormal (0.0, 0.0, 1.0);
    209   model->addVertexNormal (0.0, 1.0, 0.0);
    210   model->addVertexNormal (0.0, 0.0, -1.0);
    211   model->addVertexNormal (0.0, -1.0, 0.0);
    212   model->addVertexNormal (1.0, 0.0, 0.0);
    213   model->addVertexNormal (-1.0, 0.0, 0.0);
    214 
    215   model->addVertexTexture (0.0, 1.0);
    216   model->addVertexTexture (1.0, 1.0);
    217   model->addVertexTexture (1.0, 0.0);
    218   model->addVertexTexture (0.0, 0.0);
    219 
    220   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
    221   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
    222   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
    223   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
    224   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
    225   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
    226 
    227   model->finalize();
    228 
    229   this->setModel(model);
    230 }
Note: See TracChangeset for help on using the changeset viewer.