Пример #1
0
        protected void CreateSelector(ContentPackage package)
        {
            SolidColorSpecularMaterial materialGray = new SolidColorSpecularMaterial(new Vector3(.5f, .5f, 1f), SelectorMaterialName);

            materialGray.Load(package);
            RenderScene.AddMaterial(materialGray);
            materialGray.LightDirection = new Vector3(1f, -1f, 0f);
            materialGray.Shininess      = 3f;
            materialGray.Specularity    = .5f;

            MeshGroup selectorMesh  = package.LoadMeshGroup(SelectorMeshSource);
            Model     selectorModel = new Model()
            {
                Name = SelectorModelName, Material = materialGray, MeshGroup = selectorMesh
            };

            RenderScene.AddModel(selectorModel);

            selector = new RenderNode()
            {
                Model = selectorModel, Transform = Matrix4.Identity
            };
            RenderScene.AddRenderNode(selector);
        }