🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Interesting texture problem.

Started by
11 comments, last by gato 23 years, 12 months ago
That was a very good explanetion, thanks a lot Ysaneya!
Advertisement
how many ppl here own the red book
glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);
Zedzeek, you should reread the description of the problem. It has nothing to do with perspective correction on a *triangle* (which GL_PERSPECTIVE_CORRECTION hint is for), but on a *quad*. Even with GL_NICEST you''ll still have the same problem. A triangle is correctly displayed. In a quad with non-90° angles, if you don''t change the texture coords, the quad will appear to be shifted on its diagonal. Try with an example...

Gato: i''ve just read again my explanation, and there is maybe something wrong.. if you still have a perspective pb it can be the cause.
As you know, scaling with a different value in X and Y (as in my ex) doesn''t keep the original angles safe. I think you should use the same scaling value for X and Y. Since you want the tex coords to be between 0.0 and 1.0, you''ll have to keep the lowest scale.

Final_scale=MIN(scaleX,scaleY)
scaleX=Final_scale
scaleY=Final_scale

In my example, it would give a final scale of 1/20 for both X and Y, and the final vertex coords would be:

Vertex 1: 1.0 0.0
Vertex 2: 0.75 0.5
Vertex 3: 0.25 0.5
Vertex 4: 0.0 0.0

Ok i think it''s definately the right tex. coords (to have a perfect perspective correct trapeze).

Y.

This topic is closed to new replies.

Advertisement