Example #1
0
        public override void OnLoadContent()
        {
            _teapot = ContentManager.Load<Mesh>("teapot.ase");
            _teapot.Color = Colors.Blue;
            Scene.AddNode(_teapot);

            base.OnLoadContent();
        }
Example #2
0
        private void Game_LoadContent(Game game)
        {
            _container = new Geometry();
            game.Scene.AddNode(_container);

            _teapot = game.ContentManager.Load<Mesh>("teapot.ASE");
            _container.Children.Add(_teapot);
            _teapot.IsVisible = false;

            _box = new Box {Dimension = new Coordinate(40, 40, 40)};
            _box.Position.Set(0,10,0);
            _container.Children.Add(_box);

            _cylinder = new Cylinder {Segments = 16, Size = 20, TopRadius = 20, BottomRadius = 40};
            _cylinder.Position.Set(0, 10, 0);
            _container.Children.Add(_cylinder);

            _ring = new Ring {Segments = 16, Size = 20, InnerRadius = 20, OuterRadius = 40};
            _ring.Position.Set(0, 10, 0);
            _container.Children.Add(_ring);

            _reflectionMapTexture = LoadTexture("/Balder.Silverlight.SampleBrowser;component/Samples/Programatic/Materials/Assets/ReflectionMap.jpg");
            _visualStudioTexture = LoadTexture("/Balder.Silverlight.SampleBrowser;component/Samples/Programatic/Materials/Assets/VisualStudio.png");
            _balderLogoTexture = LoadTexture("/Balder.Silverlight.SampleBrowser;component/Samples/Programatic/Materials/Assets/BalderLogo.png");

            _flatMaterial = new Material
            {
                Diffuse = Colors.Red,
                Shade = MaterialShade.Flat
            };
            _gouraudMaterial = new Material
            {
                Diffuse = Colors.Red,
                Shade = MaterialShade.Gouraud
            };
            _texturedMaterial = new Material
            {
                DiffuseMap = _reflectionMapTexture,
                Shade = MaterialShade.Flat,
            };
            _reflectionMaterial = new Material
            {
                ReflectionMap = _reflectionMapTexture,
                Shade = MaterialShade.Flat
            };
        }