コード例 #1
0
        /// <summary>
        /// Initialize the sample.
        /// </summary>
        protected override void Initialize()
        {
            // create a default world and matrix
            world = Matrix.Identity;

            // create the mesh array
            sampleMeshes = new Model[5];

            // Set up the reference grid
            grid           = new SampleGrid();
            grid.GridColor = Color.LimeGreen;
            grid.GridScale = 1.0f;
            grid.GridSize  = 32;
            // Set the grid to draw on the x/z plane around the origin
            grid.WorldMatrix = Matrix.Identity;

            // set up the sample camera
            camera          = new SampleArcBallCamera(SampleArcBallCameraMode.RollConstrained);
            camera.Distance = 3;
            // orbit the camera so we're looking down the z=-1 axis,
            // at the "front" of the object
            camera.OrbitRight(MathHelper.Pi);
            // orbit up a bit for perspective
            camera.OrbitUp(.2f);

            // set the initial effect, technique, and mesh
            activeMesh        = 1;
            activeCombination = 0;
            activeEffect      = effectTechniqueCombinations[activeCombination, 0];
            activeTechnique   = effectTechniqueCombinations[activeCombination, 1];

            // set the initial specular values
            specularPower     = 16;
            specularIntensity = 1;

            base.Initialize();
        }