Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Tangent Space Matrix

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

function TangentMatrix16(T: PTexCoords2f ;N: PVector3f): TMatrix16f;
  t3d,b: TVector3f;
  Result := NullMatrix16;
  //generate and normalize t vector from 2d texture coords

  t3d := Vector3f(T[0],T[1],0);

  //generate bi normal


  //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;

Many thanks Mark

Share this post

Link to post
Share on other sites
Wow, I haven''t seen Pascal code in ages! That brings back some (haunting) memories! Next thing you know, someone will post some Fortran!


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!