DrFlower/Hana-SoftwareRenderer

A question of caculate tangent

Opened this issue · 0 comments

Hey, the formula for calculating tangent in your project is very helpful to me, but I don't understand why it is calculated in this way. Can you give me some hints (some links or Derived formulas)? Thank you very much.(OvO)

The formula is this : Vector3f tangent = Vector3f(x * y / std::sqrt(x * x + z * z), std::sqrt(x * x + z * z), z * y / std::sqrt(x * x + z * z));