hi, i need to multiply a vertex's texture coordinates by the texture matrix in order to make projective texturing in a vertex program. The problem is that i have little knowledge about matrix math and i don't know how to do the multiplication of a vector by a matrix, can someone help me, please?

hey jcabeleira, maybe something like this:

...

ATTRIB tc = vertex.texcoord[?];

TEMP result;

PARAM texMat[4] = { state.matrix.texture[?] };

# matrix multiply is just 4 dot products

# tc (row) into each texture matrix column

DP4 result.x, tc, texMat[0];

DP4 result.y, tc, texMat[1];

DP4 result.z, tc, texMat[2];

DP4 result.w, tc, texMat[3];

...hope this helps!

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.