View Full Version : texture under a point and stretch

06-04-2010, 02:48 PM
Hello OpenGLrs,

I have a plane as big as my viewport with a texture mapped on it.
Then there is a cursor with five points arranged as a cross. For each of them I computer the correspondent texture coordinate as

txt.x = pp[i].x/windw.with;
txt.y = pp[i].y/ widnw.height;

So I change the position of the central point, without changing its texture coordinates. I was expecting a stretch of the portion of the image but it doesn't happen anything. So I wonder why? does texture mapping works only over polygons?

Thanks for any help.

06-04-2010, 04:41 PM
What you describe should indeed stretch the texture.
Can you post the relevant code, the texture coordinates, vertex coordinates, tex gen modes, render commands, viewport, etc ?

06-05-2010, 04:19 PM
weird... well my points are arranged in a cross like this:

and my window is 300 x 400. So each point as coordinates in Pixels (x,y) and I generate texture coordinates like (x/300, y/400) which produces cooridnates in [0,1]. So, I positioned the cross, I press left-mouse to set up the texture coordinates, and I move the central point without updating it texture coordinate. If I render the cross as a sequence of 4 quads and I move the central point, it works.

06-06-2010, 12:04 PM
As I asked above, show your code !