Created
September 1, 2017 20:15
-
-
Save Makio64/cffcbb652188c43c67c7a12555146857 to your computer and use it in GitHub Desktop.
calculate normal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Math.cross : | |
[a1, a2, a3] and B = [b1, b2, b3] is defined as: | |
cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] | |
for 3 points : | |
vNormal = normalize( cross(pos2.xyz-pos.xyz, pos3.xyz-pos.xyz) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment