旋转矩阵"/>
openGL构造二维旋转矩阵
效果图:
#include<stdlib.h>
#include<GL/glut.h>#include<math.h>
GLsizei winWidth=600,winHeight=600;
GLfloat xwcMin=0.0,xwcMax=225.0;
GLfloat ywcmin=0.0,ywcMax=225.0;
class wcPt2D
{
public:
GLfloat x,y;
};
typedef GLfloat Matrix3x3[3][3];
Matrix3x3 matComposite;
const double pi=3.14159;
void init()
{
glClearColor(1.0,1.0,1.0,0.0);
}
void matrix3x3SetIdentity(Matrix3x3 matIdent3x3)
{
GLint row,col;
for(row=0;row<3;row++)
{
for(col=0;col<3;col++)
{
matIdent3x3[row][col]=(row==col);
}
}
}
void matrix3x3PreMultiply(Matrix3x3 m1,Matrix3x3 m2)
{
GLint row,col;
Matrix3x3 matTemp;
for(row=0;row<3;row++)
</
更多推荐
openGL构造二维旋转矩阵
发布评论