Jump to content
  • Advertisement
Sign in to follow this  
xujiezhige

World space to tangent space

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


// Normalize the light and view vectors and transform it to the tangent space:
float3x3 mWorldToTangent = float3x3( vTangentWS, vBinormalWS, vNormalWS );

// Propagate the view and the light vectors (in tangent space):
Out.vViewTS = mul( mWorldToTangent, vViewWS );
Out.vLightTS = mul( vLightWS, mWorldToTangent );





vLightWS, vViewWS is the lgith vector and view vector in world space.

My question is that the last two line codes are doing the same operation but with inverse order to multiply matrix. I think the last is wrong, but the program runs well. Why?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!