Hi, everyone. I tried to map a rectangular image to a non-rectangular area(considerring perspective). But the straght line in the image became bent in the result. I have tried change the filter from linear to nearest, neight of them worked.
Here is my drawing code
void vedioMap(){
//delete
float* t;
float a,b;
//vedioTexIds[0]
glDisable(GL_CULL_FACE);
glPolygonOffset(-1.f,-1.f);
glEnable(GL_POLYGON_OFFSET_FILL);
glBindTexture(GL_TEXTURE_2D, vedioTexIds[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//GL_POLYGON, GL_TRIANGLES
glBegin(GL_QUADS);
FOR(i,4) {
glTexCoord2f(screenCoord[i][0], screenCoord[i][1]);
glVertex3fv(worldCoord[0][i].data());
}
glEnd();
glDisable(GL_POLYGON_OFFSET_FILL);
}
The origin image is east1 and the result is another in the attach files.
So my question is how to keep the straight line straight?
Thanks!