Skip to main content
gamedev.net
🔒 Locked

Texture Wrapping

Started by Scooter 0 replies 500+ views
Original Post
Scooter
Scooter
Hi i''ve created a 64x64 vertex grid for my terrain using DrawIndexedPrimitive() and I apply a texture to it(grass) but the texture is streched to fit on the whole terrain which all but kills the detail level, anyway how can i Wrap the texture so it is tiled over in like a 10x10 grid. I know the SetTextureStageState(0,D3DTSS_ADDRESS,D3DTADDRESS_WRAP); but i have no idea how to set the ''texture coordinates.'' ??????
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
MrSnow
MrSnow
when you create vertex grid then you set up texture coordinates ....

forex: vertex[z] = D3DVERTEX ((x,y,z), (nx, ny), tx, ty);

tx and ty is texture coordinates (float 0...1 range)...





=============================
Denis "Mr.Snow" Kozhukhov
CEO & Lead programmer
Choco Snow Creation
dkcscPortal
=============================
=============================Denis "Mr.Snow" KozhukhovCEO & Lead programmerChoco Snow CreationdkcscPortal=============================

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.