www.pudn.com > MyGame.rar > Fragment.cpp


// Fragment.cpp: implementation of the CFragment class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "MyGame.h" 
#include "Fragment.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CFragment::CFragment() 
{ 
	c=Point3f(1,1,1); ttl=StdTTL;	 
} 
 
CFragment::~CFragment() 
{ 
 
} 
 
int CFragment::Draw() 
{ 
	glPushMatrix(); 
	glTranslate(p); 
	glRotatef(angle,axis.x(),axis.y(),axis.z()); 
	glColor3f(c[0],c[1],c[2]); 
	glBegin(GL_TRIANGLES); 
	glNormal3f(0,0,1); 
	glVertex3f( 0, 1,0); 
	glVertex3f(-1,-1,0); 
	glVertex3f( 1,-1,0); 
	glEnd(); 
 
	glPopMatrix(); 
	return 1; 
}