Sign in to follow this  

Math behind SetTransform(D3DTS_TEXTUREX)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this