void Tesselator(int NumberOfVVertices, int NumberOfUVertices)
{

Vstep = 1 / (NumberOfVVertices-1);
Ustep = 1 / (
NumberOfUVertices-1);

M = B * P * BT;

for(unsigned int vInt=0; vInt < NumberOfVVertices; vInt++)
{

vFloat = vInt * Vstep;
vVector = [vFloat3 vFloat2 vFloat 1];
vTVector = [3*vFloat2 2*vFloat 1 0];

Dv = vVector * M;
DTv = vTVector * M;

for(unsigned int uInt=0; uInt < NumberOfUVertices; uInt++)
{

uFloat = uInt * Ustep;
uVector = [uFloat3 uFloat2 uFloat 1];
uTVector = [3*uFloat2 2*uFloat 1 0];

Vtx= Dv * uVector;//This is a 1x4 mult 1x4 per X,Y,Z,W output(Vtx);

TangentU = Dv * uTVector;
TangentV = DTv * uVector;
Normal = Normalize(CrossProduct(TangentV, TangentU));
output(Normal);

}

}

}

>>>Back