Archived

This topic is now archived and is closed to further replies.

gamedream

Triangle with a Texture

Recommended Posts

gamedream    122
If a triangle or pyrmaid, and I want to paste a texture. what is the value of the vector (tu, tv)? because it don''t have 4 points, therefore, it will not occur (0,0), (1.0), (0,1), (1,1).

Share this post


Link to post
Share on other sites
QRebound    196
I think you are confused. Let me clear it up for you. You select a point, and then you set its Texture coordinates, or what part of the TEXTURE that will be put there, and then you do that for each point, and then set the Texture in the render function, and draw your objects... so, 0.0f, 0.0f would be upper left corner, 1.0f, 1.0f would be lower right, and 0.5f, 0.5f would be the center of the texture. Hope that helps

QRebound

Share this post


Link to post
Share on other sites
DrunkenHyena    805
Stated another way, the texture is still square (well, rectangular anyway) so it has coordinates going from 0.0 to 1.0 in the 4 corners. You have to decide how that square texture will be mapped to a non-square surface.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites