public Couleur specular(Object3D b, V3 v, Couleur color_surface) { V3 copy_v = new V3(v); copy_v.Normalize(); V3 copy_pos = new V3(this.direction); copy_pos.Normalize(); float sca = (copy_pos * copy_v); V3 v_curent_perfect = (copy_v * sca * 2.0f) - copy_pos; V3 v_current_oeil = -(v + b.getPosition()) + RenderSing.getCurrentRender().getEyesPosition(); float a = (float)Math.Pow((Math.Max((v_curent_perfect * v_current_oeil) / (v_curent_perfect.Norm() * v_current_oeil.Norm()), 0)), 25); return(this.couleur * a); }
public Couleur diffuse(Object3D b, V3 v, Couleur color_surface) { V3 vectpoint_lamp = this.direction; V3 vectPoint_tang = v; return(color_surface * this.couleur * Math.Max((vectpoint_lamp * vectPoint_tang) / (vectpoint_lamp.Norm() * vectPoint_tang.Norm()), 0.0f)); }