Archived

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

Guest Anonymous Poster

D3D poly's

This topic is 6659 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 !!

If you want a texture to repeat on the face, you just have to set different uv coors.

Normally in a face you have (if it's stretched to fit the whole face) these uv's:

Vertex 1 : 0,0
vertex 2 : 1,0
vertex 3 : 1,1

and for the other face

Vertex 1 : 1,0
Vertex 2 : 1,1
Vertex 3 : 0,1

Something like that. Now, if you want the texture repeated, just set them like that:

Vertex 1 : 0,0
vertex 2 : 3,0
vertex 3 : 3,3

and for the other face

Vertex 1 : 3,0
Vertex 2 : 3,3
Vertex 3 : 0,3

As you can see the u and v's are greater that 1. In this example the texture would be repeated 3 times across the face.

You can control what Direct3D shall be in such a case (u and/or v greater than 1=100%) with a SetRenderState !!
Sorry, I don't remember what exactely to use as the parameters (these are very hard to remember), just search you documentation for WRAP or CLAMP. By the way, Wrap mode (so, what you want) is the default of Direct3D, so at the moment don't care about SetRenderState.

Just set your UVs greater than 1 and everything should be ok.


Phillip

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In Quake, creating a large polygon (a rectangle or something) would mean two large triangles right? With that large poly, the textures are repeated instead of stretched across. How is this possible to do in D3D when all it does is stretch the texture across three or four points?

Share this post


Link to post
Share on other sites