Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. GLfloat* norm(GLfloat x1, GLfloat y1, GLfloat z1,
  2. GLfloat x2, GLfloat y2, GLfloat z2,
  3. GLfloat x3, GLfloat y3, GLfloat z3);
  4.  
  5. GLfloat* norm(GLfloat x1, GLfloat y1, GLfloat z1,
  6. GLfloat x2, GLfloat y2, GLfloat z2,
  7. GLfloat x3, GLfloat y3, GLfloat z3) {
  8. GLfloat *normal = new GLfloat[3];
  9. normal[0] = (y1-y2)*(z1-z3) - (z1-z2)*(y1-y3);
  10. normal[1] = (x1-x3)*(z1-z2) - (x1-x3)*(z1-z3);
  11. normal[2] = (x1-x2)*(y1-y3) - (x1-x3)*(y1-y2);
  12. return normal;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement