Esempio n. 1
0
        public static void ColorMaterialWithZone(MaterialPtr eMat, Zones z)
        {
            eMat.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
            ColourValue c = CityManager.GetZoneColor(z);

            eMat.SetDiffuse(c.r, c.g, c.b, 0.5f);
            eMat.SetDepthWriteEnabled(false);
        }
Esempio n. 2
0
        public static void ColorMaterialWithResource(MaterialPtr eMat, ResourceDict resources, ResourceType r)
        {
            ColourValue c   = CityManager.GetResourceColor(r);
            double      val = resources[r];

            val = Math.Log10(val) / 6.0;
            val = Math.Min(Math.Max(val, 0), 1);
            eMat.SetDiffuse(c.r, c.g, c.b, (float)val);
            eMat.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
            eMat.SetDepthWriteEnabled(false);
        }