# texture uv

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

## Recommended Posts

Hello, I have a uv coordinate question. When you texture two triangles the uv coordinates would be : 0,1 ****** 1,1 * /* * / * * / * 0,0 ****** 1,0 (By the way: i use gl_triangles and read a triangle and uv like this: x y z u v 20.0 80.0 0.0 1.0 1.0 20.0 20.0 0.0 1.0 0.0 100.0 20.0 0.0 0.0 0.0 20.0 80.0 0.0 1.0 1.0 100.0 20.0 0.0 0.0 0.0 100.0 80.0 0.0 0.0 1.0 ) This i understand. What would be the texture coordinates for a shape build of four triangles, like so: ****** * /* * / * * / * ****** * /* * / * * / * ****** I like to put the texture over the whole shape ! Is this possible and what are then the uv coordinates ???? Can someone explain this to me ? Thanx

##### Share on other sites
Your diagrams got a little screwed up... But I think you want to read up on UV values and why they are in the 0.0 to 1.0 range. To stretch it out over 4 triangles like you show:

0,1**********1,1*        /   **     /0,.5*********1,.5*        /   **     /      *0,0**********1,0

The idea is pretty simple. Take the entire surface that you want the texture to be applied to. The corners of this entire surface will always be (0,0) (1,0) (1,1) (0,1). If you want the texture cordinate of any point on that surface, find how far it is (percentage) along the U and V axis. Then this value is your texture coordinate if you're going from 0 to 1.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 14
• 46
• 22
• 27
• ### Forum Statistics

• Total Topics
634048
• Total Posts
3015233
×