Jump to content
  • Advertisement
Sign in to follow this  

Math behind SetTransform(D3DTS_TEXTUREX)

This topic is 3284 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

Hello! At the moment im trying to create some ground texture animation. Like lava should flow or waterfalls fall down. Im doing it using a matrix and D3DTS_TEXTURE0 and D3DTS_TEXTURE1. For rendering the terrain i use Vertices with 2 texturecoordinates. As there are up to 4 different texturelayers blended over each other i use a shader to do that. The first texturecoordinates are for each texture and the second for an alphamap that holds the alphavalues to blend. In the static case every texturelayer uses the same texturecoordinates and every alphalayer the same alphacoordinates. So transforming TEXTURE0 and TEXTURE1 results in animating every layer on the same way. But actually i want to animate every layer on its own. For that i need to understand how the coordinates get transformed so that i can pass a float-array to the shader with the coordinates. So my question: Is SetTransform(D3DTS_TEXTURE0, matrix) somewhat like that: D3DXVECTOR3 coords(coordU, coordV, 0); D3DXVECTOR4 vOut; D3DXVec3Transform(&vOut, &coords, &matrix); coordU = vOut.x; coordV = vOut.y; or is it working else? Greetings Plerion

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!