Guest User

Untitled

a guest
Apr 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1.                         Vector3f interNorm = Vector3f(  v1norm[0] * alpha + v2norm[0] * beta + v3norm[0] * gama,
  2.                                                         v1norm[1] * alpha + v2norm[1] * beta + v3norm[1] * gama,
  3.                                                         v1norm[2] * alpha + v2norm[2] * beta + v3norm[2] * gama);
  4.                         interNorm /= interNorm.len();
  5.  
  6.                         float dotinl = interNorm[0] * light[0] + interNorm[1]* light[1] + interNorm[2] * light[2];
  7.                         Vector3f reflect =(interNorm * 2 * (light[0] * interNorm[0] + light[1] * interNorm[1] + light[2] * interNorm[2])) - light;
  8.                         reflect /= reflect.len();
  9.                         float dotcr = camera[0] * reflect[0] + camera[1] * reflect[1] + camera[2] + reflect[2];
  10.                         intensity += (kd*dotinl + ks*pow(dotcr,50));
  11.                         putColorPoint(x, y, depth, intensity);
  12.                         intensity = 0.15;
Add Comment
Please, Sign In to add comment