Пример #1
0
        private void translucentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            sphere = new Sphere3D();
            sphere.Generate(new List <double>()
            {
                2, 64, 64
            });
            Scene3D scene = new Scene3D();

            scene.LightList.Add(light);
            scene.AddObject(sphere);
            sphere.AmbientColor  = Color.FromArgb(255, 255, 255);
            sphere.DiffuseColor  = Color.FromArgb(255, 255, 255);
            sphere.SpecularColor = Color.White;
            sphere.Shininess     = 20;
            sphere.ShowVertices  = false;
            sphere.ShowWireFrame = false;
            sphere.ShowSurfaces  = true;
            sphere.UseLight      = true;
            sphere.ShadingModel  = ShadingModel.Smooth;
            sphere.SetAlpha(0.5f);
            Sphere3D smallSphere = new Sphere3D();

            smallSphere.Generate(new List <double>()
            {
                1.5, 64, 64
            });
            smallSphere.AmbientColor  = Color.FromArgb(0, 0, 255);
            smallSphere.DiffuseColor  = Color.FromArgb(0, 0, 255);
            smallSphere.SpecularColor = Color.White;
            smallSphere.Shininess     = 20;
            smallSphere.SetUniformColor(Color.White); // This color is used ONLY for the wireframe.
            smallSphere.ShowVertices  = false;
            smallSphere.ShowWireFrame = false;
            smallSphere.ShowSurfaces  = true;
            smallSphere.UseLight      = true;
            smallSphere.ShadingModel  = ShadingModel.Smooth;
            scene.AddObject(smallSphere);
            scene.SortForTranslucence();
            viewer3D.Scene = scene;
        }