用OPENGL如何给立方体各个面着色
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/10 12:04:51
用OPENGL如何给立方体各个面着色
glutWireCube(1.0)
用上述语句如何给已经画出来的立方体的各个面着色.六个面的颜色各不相同.答的好的快的有追加.
glutWireCube(1.0)
用上述语句如何给已经画出来的立方体的各个面着色.六个面的颜色各不相同.答的好的快的有追加.
GLfloat color[6][3]={{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0},
{1.0,1.0,0.0},{1.0,0.0,1.0},{0.0,1.0,1.0}};
int tempc[3][3][6];
GLfloat xRot = 10.0f;
GLfloat yRot = 10.0f;
int rotateType=0;
int rotateOK=0;
int rotateRate=50;
int rotate=0;
void drawcube(int cl[6])
{
glBegin(GL_QUADS);
glColor3fv(color[cl[0]]);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glColor3fv(color[cl[1]]);
glVertex3f(-0.14f,-0.14f,0.14f);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(-0.14f,-0.14f,-0.14f);
glColor3fv(color[cl[2]]);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(-0.14f,-0.14f,0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glColor3fv(color[cl[3]]);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(-0.14f,-0.14f,-0.14f);
glColor3fv(color[cl[4]]);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glColor3fv(color[cl[5]]);
glVertex3f(-0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glVertex3f(-0.14f,-0.14f,0.14f);
glEnd();
glFlush();
}
{1.0,1.0,0.0},{1.0,0.0,1.0},{0.0,1.0,1.0}};
int tempc[3][3][6];
GLfloat xRot = 10.0f;
GLfloat yRot = 10.0f;
int rotateType=0;
int rotateOK=0;
int rotateRate=50;
int rotate=0;
void drawcube(int cl[6])
{
glBegin(GL_QUADS);
glColor3fv(color[cl[0]]);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glColor3fv(color[cl[1]]);
glVertex3f(-0.14f,-0.14f,0.14f);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(-0.14f,-0.14f,-0.14f);
glColor3fv(color[cl[2]]);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(-0.14f,-0.14f,0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glColor3fv(color[cl[3]]);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(-0.14f,-0.14f,-0.14f);
glColor3fv(color[cl[4]]);
glVertex3f(-0.14f,0.14f,-0.14f);
glVertex3f(-0.14f,0.14f,0.14f);
glVertex3f(0.14f,0.14f,0.14f);
glVertex3f(0.14f,0.14f,-0.14f);
glColor3fv(color[cl[5]]);
glVertex3f(-0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,-0.14f);
glVertex3f(0.14f,-0.14f,0.14f);
glVertex3f(-0.14f,-0.14f,0.14f);
glEnd();
glFlush();
}
给.着色用英语怎么说
如何给google earth某区域内着色?
在C4D里边建立一个立方体之后,如何给这个立方体的六个面贴上不同的图片呢?
在PPT中如何给图形重合部分单独着色?
如何使果实着色
opengl gluPerspective函数怎么用?
让我们给这个风筝着色 用英语怎么说?
立方体的体对角线如何求?麻烦给个公式~
高锰酸钾着色皮肤如何处理
AutoCAD如何给球体着色.要获得一个着三色的整体球
OPENGL 如何将 3dmax 中的模型 导入到opengl 中 需要插件么
甲球与某立方体的各个面都相切,乙球于这个立方体的各条棱都相切,丙球过这个立方体的所有顶点,则甲,乙,丙三球半径的平方之比