【发布时间】:2015-09-15 03:28:29
【问题描述】:
我正在尝试使用lwjgl。
我正在使用此代码绘制 3D 立方体(广告有效):
glBegin(GL_QUADS);
//glColor3f(1,0,0); // ROUGE
glTexCoord2f(0,0); glVertex3f( x , y , z );
glVertex3f( x+size, y , z );
glVertex3f( x+size, y , z+size);
glVertex3f( x , y , z+size);
//glColor3f(1,0.5f,0); // ORANGE
glVertex3f( x , y+size, z );
glVertex3f( x+size, y+size, z );
glVertex3f( x+size, y , z );
glVertex3f( x , y , z );
//glColor3f(0,0,1); // BLEU
glVertex3f( x , y , z );
glVertex3f( x , y , z+size);
glVertex3f( x , y+size, z+size);
glVertex3f( x , y+size, z );
//glColor3f(1,1,0); // JAUNE
glVertex3f( x+size, y+size, z );
glVertex3f( x+size, y+size, z+size);
glVertex3f( x+size, y , z+size);
glVertex3f( x+size, y , z );
//glColor3f(1,0,1); // ROSE
glVertex3f( x , y , z+size);
glVertex3f( x+size, y , z+size);
glVertex3f( x+size, y+size, z+size);
glVertex3f( x , y+size, z+size);
//glColor3f(0,1,0); // ROUGE
glVertex3f( x , y+size, z+size);
glVertex3f( x+size, y+size, z+size);
glVertex3f( x+size, y+size, z );
glVertex3f( x , y+size, z );
glEnd();
我想在每张脸上(在精灵表中)放置不同的图像。
这段代码让脸红了:
glColor3f(1,0,0);
请问我怎样才能在每张脸上都放一张图片? ()
编辑:
我试过mallard的例子,但我得到了这个结果: image
【问题讨论】: