Changeset 7981 in orxonox.OLD for branches/atmospheric_engine/src/world_entities
- Timestamp:
- May 30, 2006, 3:30:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/world_entities/effects/billboard.cc
r7965 r7981 63 63 64 64 this->material = new Material(); 65 this->setTexture("maps/lightning_bolt.png");66 this->setAbsCoor(0, 0, 0);65 //this->setTexture("maps/lightning_bolt.png"); 66 //this->setAbsCoor(0, 0, 0); 67 67 this->setVisibiliy(true); 68 68 this->setSize(10, 10); … … 141 141 return; 142 142 143 //PRINTF(0)("draw\n");144 145 143 glPushMatrix(); 146 144 … … 148 146 glTranslatef(0,0,0); 149 147 this->material->select(); 150 148 /* 151 149 glBegin(GL_QUADS); 152 150 glTexCoord2f(1.0f, 1.0f); glVertex3f(-sizeX/2, -sizeY/2, 0.0f); … … 155 153 glTexCoord2f(1.0f, 0.0f); glVertex3f(-sizeX/2, sizeY/2, 0.0f); 156 154 glEnd(); 157 155 */ 156 157 const PNode* camera = State::getCameraNode(); //!< @todo MUST be different 158 Vector cameraPos = camera->getAbsCoor(); 159 Vector cameraTargetPos = State::getCameraTargetNode()->getAbsCoor(); 160 Vector view = cameraTargetPos - cameraPos; 161 Vector up = Vector(0, 1, 0); 162 up = camera->getAbsDir().apply(up); 163 Vector h = up.cross(view); 164 Vector v = h.cross(view); 165 h.normalize(); 166 v.normalize(); 167 168 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();*/ 191 192 glBegin(GL_QUADS); 193 glTexCoord2f(0.0f, 0.0f); 194 glVertex3f(0 - h.x - v.x, 195 0 - h.y - v.y, 196 0 - h.z - v.z); 197 glTexCoord2f(1.0f, 0.0f); 198 glVertex3f( 0 + h.x - v.x, 199 0 + h.y - v.y, 200 0 + h.z - v.z); 201 glTexCoord2f(1.0f, 1.0f); 202 glVertex3f(0 + h.x + v.x, 203 0 + h.y + v.y, 204 0 + h.z + v.z); 205 glTexCoord2f(0.0f, 1.0f); 206 glVertex3f(0 - h.x + v.x, 207 0 - h.y + v.y, 208 0 - h.z + v.z); 209 glEnd(); 210 211 158 212 glPopMatrix(); 159 213 }
Note: See TracChangeset
for help on using the changeset viewer.