Jump to content
  • Advertisement
Sign in to follow this  
Knut

Ortho texture issue

This topic is 2234 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I am trying to render a textured quad in ortho mode. When I render it as a rectangle, it works fine, as this picture shows:
square11.png?w=404

However, when I try to move one corner half way to the center, the texture gets weirdly skeeved:
square21.png?w=405

Notice the red line going up. I would think that it should be sloped towards the upper right corner, but it's rendered straight up. Is this normal?
There is only one textured quad in this picture, rendered using fixed function pipeline. The texture coords are all either 0 or 1 in the corners. Why is the texture rendered like this?

Thanks in advance.
Knut

Share this post


Link to post
Share on other sites
Advertisement
OpenGL can only correctly render planar quads (quads where the four vertices are on a plane). Due to the way the position and texture coordinates interact to form vertices, your quad isn't planar anymore when you shift the position like that without altering the texture coordinate.

Read this: clicky.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!