我正在使用此库在我的应用中实现coverflow http://www.chaosinmotion.com/flowcover.html
现在我想从图像中删除镜像,如上面的链接所示。它是在opengl中开发的。有人可以告诉我如何从中删除图像镜像吗?
由于 Ayaz Alavi
答案 0 :(得分: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();
}