Changeset 8026 in orxonox.OLD for branches/atmospheric_engine/src/world_entities/effects
- Timestamp:
- May 31, 2006, 2:20:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/world_entities/effects/billboard.cc
r7981 r8026 63 63 64 64 this->material = new Material(); 65 //this->setTexture("maps/lightning_bolt.png"); 66 //this->setAbsCoor(0, 0, 0); 65 this->setAbsCoor(0, 0, 0); 67 66 this->setVisibiliy(true); 68 this->setSize( 10, 10);67 this->setSize(5, 5); 69 68 } 70 69 … … 92 91 this->sizeX = sizeX; 93 92 this->sizeY = sizeY; 93 94 PRINTF(0)("sizeX: %f sizeY: %f", sizeX, sizeY); 94 95 } 95 96 … … 110 111 */ 111 112 void Billboard::tick(float dt) 112 {/* 113 float z = 0.0f; 114 glReadPixels ((int)this->getAbsCoor2D().x, 115 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1, 116 1, 117 1, 118 GL_DEPTH_COMPONENT, 119 GL_FLOAT, 120 &z); 121 122 GLdouble objX=.0, objY=.0, objZ=.0; 123 gluUnProject(this->getAbsCoor2D().x, 124 GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1, 125 .99, // z 126 GraphicsEngine::modMat, 127 GraphicsEngine::projMat, 128 GraphicsEngine::viewPort, 129 &objX, 130 &objY, 131 &objZ );*/ 113 { 132 114 } 133 115 … … 144 126 145 127 //glTranslatef(this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z); 146 glTranslatef(0,0,0);128 //glTranslatef(0,0,0); 147 129 this->material->select(); 148 /*149 glBegin(GL_QUADS);150 glTexCoord2f(1.0f, 1.0f); glVertex3f(-sizeX/2, -sizeY/2, 0.0f);151 glTexCoord2f(0.0f, 1.0f); glVertex3f( sizeX/2, -sizeY/2, 0.0f);152 glTexCoord2f(0.0f, 0.0f); glVertex3f( sizeX/2, sizeY/2, 0.0f);153 glTexCoord2f(1.0f, 0.0f); glVertex3f(-sizeX/2, sizeY/2, 0.0f);154 glEnd();155 */156 130 157 131 const PNode* camera = State::getCameraNode(); //!< @todo MUST be different … … 167 141 168 142 float radius = 5; 169 v *= .5 * radius; 170 h *= .5 * radius; 171 /* 172 glBegin(GL_TRIANGLE_STRIP); 173 glTexCoord2i(1, 1); 174 glVertex3f(0 - h.x - v.x, 175 0 - h.y - v.y, 176 0 - h.z - v.z); 177 glTexCoord2i(0, 1); 178 glVertex3f(0 - h.x + v.x, 179 0 - h.y + v.y, 180 0 - h.z + v.z); 181 glTexCoord2i(1, 0); 182 glVertex3f(0 + h.x - v.x, 183 0 + h.y - v.y, 184 0 + h.z - v.z); 185 glTexCoord2i(0, 0); 186 glVertex3f(0 + h.x + v.x, 187 0 + h.y + v.y, 188 0 + h.z + v.z); 189 190 glEnd();*/ 143 v *= .5 * sizeX; 144 h *= .5 * sizeY; 191 145 192 146 glBegin(GL_QUADS); 193 147 glTexCoord2f(0.0f, 0.0f); 194 glVertex3f( 0- h.x - v.x,195 0- h.y - v.y,196 0- h.z - v.z);148 glVertex3f(this->getAbsCoor().x - h.x - v.x, 149 this->getAbsCoor().y - h.y - v.y, 150 this->getAbsCoor().z - h.z - v.z); 197 151 glTexCoord2f(1.0f, 0.0f); 198 glVertex3f( 0+ h.x - v.x,199 0+ h.y - v.y,200 0+ h.z - v.z);152 glVertex3f( this->getAbsCoor().x + h.x - v.x, 153 this->getAbsCoor().y + h.y - v.y, 154 this->getAbsCoor().z + h.z - v.z); 201 155 glTexCoord2f(1.0f, 1.0f); 202 glVertex3f( 0+ h.x + v.x,203 0+ h.y + v.y,204 0+ h.z + v.z);156 glVertex3f(this->getAbsCoor().x + h.x + v.x, 157 this->getAbsCoor().y + h.y + v.y, 158 this->getAbsCoor().z + h.z + v.z); 205 159 glTexCoord2f(0.0f, 1.0f); 206 glVertex3f( 0- h.x + v.x,207 0- h.y + v.y,208 0- h.z + v.z);160 glVertex3f(this->getAbsCoor().x - h.x + v.x, 161 this->getAbsCoor().y - h.y + v.y, 162 this->getAbsCoor().z - h.z + v.z); 209 163 glEnd(); 210 164
Note: See TracChangeset
for help on using the changeset viewer.