0

我正在使用这个库在我的应用程序 http://www.chaosinmotion.com/flowcover.html中实现coverflow

现在我想从图像中删除镜像,如您在上面的链接中所见。它是用opengl开发的。谁能告诉我如何从中删除镜像?

谢谢阿亚兹阿拉维

4

1 回答 1

1

在 FlowCoverView.m 文件中替换此方法将消除镜像效果。

- (void)drawTile:(int)index atOffset:(double)off
{
FlowCoverRecord *fcr = [self getTileAtIndex:index];
GLfloat m[16];
memset(m,0,sizeof(m));
m[10] = 1;
m[15] = 1;
m[0] = 1;
m[5] = 1;
double trans = off * SPREADIMAGE;

double f = off * FLANKSPREAD;
if (f < -FLANKSPREAD) {
    f = -FLANKSPREAD;
} else if (f > FLANKSPREAD) {
    f = FLANKSPREAD;
}
m[3] = -f;
m[0] = 1-fabs(f);
double sc = 0.45 * (1 - fabs(f));
trans += f * 1;

glPushMatrix();
glBindTexture(GL_TEXTURE_2D,fcr.texture);
glTranslatef(trans, 0, 0);
glScalef(sc,sc,1.0);
glMultMatrixf(m);
glDrawArrays(GL_TRIANGLE_STRIP,0,4);

// reflect
    //  glTranslatef(0,-2,0);
    //  glScalef(1,-1,1);
    //  glColor4f(0.5,0.5,0.5,0.5);
    //  glDrawArrays(GL_TRIANGLE_STRIP,0,4);
    //  glColor4f(1,1,1,1);

glPopMatrix();

}

于 2012-04-09T13:42:51.187 回答