Exemplo n.º 1
0
 public void CalculateBlinnPhongLight(Vect4 light, Vect4 view, float ka, float kd, float ks, float h)
 {
     //Check if face is visible
     if (mr.enabled == true)
     {
         float Ia = ka * 1;
         float Id = kd * normal.DotProduct(normal, light);
         Vect4 H  = view.Addition(light);
         H.Normalize();
         float Is = ks * Mathf.Pow(H.DotProduct(H, normal), h);
         float I  = Ia + Id + Is;
         mr.material.SetColor("_Color", IndexedFace.Instance.materialColor * I);
     }
 }
Exemplo n.º 2
0
 public void ChangeLocalCenter(Vect4 translation)
 {
     localCenter = localCenter.Addition(translation);
 }