Tag: Math
All the articles with the tag "Math".
What Decides the Matrix for a Normal Isn't the Inverse, It's Where the Vector Sits
Lecture notes on vertex processing, clipped while studying shaders by applying them. I checked three of its rules against the specs — the matrix a normal gets multiplied by, the cross-product order for the three camera axes, and what to change going from right-handed to left-handed. On the normal, the inverse isn't the wrong answer; what's missing is which side the vector sits on.
Unmuting Puts a dB Value Where a Linear One Belongs
The reason for using an AudioMixer and the explanation of the log conversion are both accurate. But the unmute code feeds a dB value into a linear slot, so instead of restoring the volume it writes NaN or -Infinity.
There Are Two Clamps: Swap the Arguments and Only One Throws
Mathf.Clamp takes four lines to explain. The trouble is everything outside those four lines: what happens when you swap the bounds, when NaN arrives, and when you clamp an angle.