- Timestamp:
- Dec 20, 2005, 3:45:53 AM (19 years ago)
- Location:
- branches/christmas_branche/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
r6180 r6181 177 177 { 178 178 glPushMatrix(); 179 this->renderFrame(); 179 // this->renderFrame(); 180 renderFrameTriangles(); 180 181 glPopMatrix(); 181 182 } … … 223 224 glPopAttrib(); 224 225 } 226 227 228 229 230 231 void MD2Model::renderFrameTriangles() const 232 { 233 static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 234 int* pCommands = this->data->pGLCommands; 235 /* some face culling stuff */ 236 // glPushAttrib(GL_POLYGON_BIT); 237 // glFrontFace(GL_CW); 238 // glEnable(GL_CULL_FACE); 239 // glCullFace(GL_BACK); 240 241 // this->processLighting(); 242 // this->interpolate(/*verticesList*/); 243 this->data->material->select(); 244 245 /* draw the triangles */ 246 glBegin(GL_TRIANGLES); 247 248 for( int i = 0, k = 0; i < this->data->numTriangles; ++i, k += 3) 249 { 250 //printf("%i: (%f, %f)\n", i, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t); 251 252 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].s, 253 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].t); 254 //glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 255 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[0]]); 256 257 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].s, 258 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].t); 259 260 // glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 261 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[1]]); 262 263 glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, 264 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t); 265 // glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z); 266 glVertex3fv(this->data->pVertices[this->data->pTriangles[i].indexToVertices[2]]); 267 } 268 269 glEnd(); 270 } 271 272 273 274 275 276 277 278 279 280 281 225 282 226 283 -
branches/christmas_branche/src/lib/graphics/importer/md2Model.h
r6180 r6181 214 214 215 215 virtual void draw() const; 216 void renderFrameTriangles() const; 217 216 218 217 219 void setAnim(int type); -
branches/christmas_branche/src/world_entities/creatures/md2_creature.cc
r6180 r6181 93 93 cannon->setName("BFG"); 94 94 95 //this->getWeaponManager()->addWeapon(wpLeft, 1, 0);96 //this->getWeaponManager()->addWeapon(wpRight,1 ,1);97 //this->getWeaponManager()->addWeapon(cannon, 0, 6);95 // this->getWeaponManager()->addWeapon(wpLeft, 1, 0); 96 // this->getWeaponManager()->addWeapon(wpRight,1 ,1); 97 // this->getWeaponManager()->addWeapon(cannon, 0, 6); 98 98 99 99 //this->getWeaponManager()->addWeapon(turret, 3, 0); … … 111 111 this->setClassID(CL_MD2_CREATURE, "MD2Creature"); 112 112 113 PRINTF(4)(" SPACESHIPINIT\n");113 PRINTF(4)("MD2CREATURE INIT\n"); 114 114 115 115 EventHandler::getInstance()->grabEvents(true); … … 247 247 void MD2Creature::tick (float time) 248 248 { 249 250 249 if( likely(this->getModel(0) != NULL)) 251 250 ((MD2Model*)this->getModel(0))->tick(time); … … 289 288 this->weaponAction(); 290 289 } 290 291 291 292 292 /**
Note: See TracChangeset
for help on using the changeset viewer.