public void Shading(Foco3D[] Focos, Camara3D Camara) { if ((Focos != null)) { for (int i = 0; i <= mCaras.GetUpperBound(0); i++) { mCaras[i].Shading(mConstantesShading, Focos, Camara); } } else { for (int i = 0; i <= mCaras.GetUpperBound(0); i++) { mCaras[i].ColorShading = Color.Black; } } }
public void ObtenerReferenciaFoco(ref Foco3D Foco, int Indice) { if (Indice >= 0 && Indice <= mFocos.GetUpperBound(0)) { Foco = mFocos[Indice]; } }
public void QuitarFoco(ref Foco3D Foco) { if ((mFocos != null) && mFocos.Contains(Foco)) { if (mFocos.GetUpperBound(0) > 0) { Foco3D[] Copia = new Foco3D[mFocos.GetUpperBound(0) + 1]; mFocos.CopyTo(Copia, 0); mFocos = new Foco3D[mFocos.GetUpperBound(0)]; for (int i = 0; i <= Copia.GetUpperBound(0); i++) { if (Copia[i] != Foco) { if (i <= mFocos.GetUpperBound(0)) { mFocos[i] = Copia[i]; } else { mFocos[i - 1] = Copia[i]; } } } Foco.Modificado -= FocoModificado; } else { mFocos = null; } if (Modificado != null) { Modificado(this); } } }
public void AñadirFoco(ref Foco3D Foco) { if ((mFocos != null)) { Array.Resize(ref mFocos, mFocos.GetUpperBound(0) + 2); } else { mFocos = new Foco3D[1]; } mFocos[mFocos.GetUpperBound(0)] = Foco; Foco.Modificado += FocoModificado; FocoModificado(ref Foco); }
private void FocoModificado(ref Foco3D Sender) { Shading(); }
public void Shading(PhongShader Constantes, Foco3D[] Focos, Camara3D Camara) { mColorShading = Constantes.EcuacionPhong(Focos, mNormalSUR, mBaricentroSUR, mColor, Camara); }