Changeset 10404 in orxonox.OLD for trunk/src/world_entities/blackscreen.cc
- Timestamp:
- Jan 27, 2007, 2:20:24 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/blackscreen.cc
r10403 r10404 23 23 #include "material.h" 24 24 #include "state.h" 25 #include "camera.h"26 #include " static_model.h"25 // #include "camera.h" 26 #include "primitive_model.h" 27 27 28 28 ObjectListDefinition(BlackScreen); … … 74 74 this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 75 75 76 this->build(); 76 PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10); 77 this->setModel(model); 77 78 78 79 i=0; … … 101 102 glEnable(GL_BLEND); // Turn Blending On 102 103 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 ); 111 112 112 113 this->material->select(); … … 139 140 140 141 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); 144 145 } 145 146 … … 188 189 return 0; 189 190 } 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); // back221 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front222 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom223 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top224 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left225 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right226 227 model->finalize();228 229 this->setModel(model);230 }
Note: See TracChangeset
for help on using the changeset viewer.