function TangentMatrix16(T: PTexCoords2f ;N: PVector3f): TMatrix16f;
var
t3d,b: TVector3f;
begin
Result := NullMatrix16;
//generate and normalize t vector from 2d texture coords
t3d := Vector3f(T[0],T[1],0);
Normalize(t3d);
//generate bi normal
CrossProd(@n,@t3d,b);
Normalize(b);
//populate matrix
Result[0] := t3d[0]; Result[1] := t3d[1]; Result[2] := t3d[2];
Result[4] := b[0]; Result[5] := b[1]; Result[6] := b[2];
Result[8] := n[0]; Result[9] := n[1]; Result[10] := n[2];
Result[15] := 1;
end;
Tangent Space Matrix
Hello all,
im currently implimenting Dot3 Bump mapping
in the graphics side of my engine and am
having problems generating the tangent
matrix,could anyone possibly point out what
is wrong with the following code
Many thanks
Mark
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement