Skip to content

Instantly share code, notes, and snippets.

@Madsy
Last active December 21, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Madsy/6292355 to your computer and use it in GitHub Desktop.
Save Madsy/6292355 to your computer and use it in GitHub Desktop.
float wReci =b1*v1.w + b2*v2.w + b3*v3.w; //v1/v2/v3's w is already flipped to 1/w
float sReci = b1*v1.s + b2*v2.s + b3*v3.s; //v1/v2/v3's s is already flipped to s/w
float finalW = 1.0f / wReci;
float finalS = sReci * finalW;
/* use s ..
..
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment