Ejemplo n.º 1
0
 private void RebuildGeosphere()
 {
     if (_inputDelay < 0)
     {
         Util.ReleaseCom(ref _geosphereModel);
         _geosphereModel = new BasicModel();
         _geosphereModel.CreateGeosphere(Device, 5, _subdivisions);
         _geosphere.Model             = _geosphereModel;
         _geosphereModel.Materials[0] = _material;
         _inputDelay = 1;
     }
 }
Ejemplo n.º 2
0
        public override bool Init()
        {
            if (!base.Init())
            {
                return(false);
            }
            Effects.InitAll(Device);
            InputLayouts.InitAll(Device);
            RenderStates.InitAll(Device);

            _texMgr = new TextureManager();
            _texMgr.Init(Device);


            _geosphereModel = new BasicModel();
            _geosphereModel.CreateGeosphere(Device, 5, _subdivisions);
            _geosphereModel.Materials[0] = _material;

            _sphereModel = new BasicModel();
            _sphereModel.CreateSphere(Device, 5, 20, 20);
            _sphereModel.Materials[0] = new Material()
            {
                Ambient  = Color.Blue,
                Diffuse  = Color.Red,
                Specular = new Color4(16.0f, 0.75f, 0.75f, 0.75f)
            };

            _geosphere = new BasicModelInstance(_geosphereModel)
            {
                World = Matrix.Identity
            };
            _sphere = new BasicModelInstance(_sphereModel);


            return(true);
        }