📄 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;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -