} // Update

        #endregion

        #region Render Gizmo For Picker

        /// <summary>
        /// Render the gizmo to the picker.
        /// </summary>
        private void RenderGizmoForPicker(GameObject3D gizmoCamera)
        {
            // Calculate the center, scale and orientation of the gizmo.
            Vector3    center;
            Quaternion orientation;
            float      scale;

            GizmoScaleCenterOrientation(selectedObject, gizmoCamera, out scale, out center, out orientation);

            // Calculate the gizmo matrix.
            Matrix transformationMatrix = Matrix.CreateScale(scale);

            transformationMatrix *= Matrix.CreateFromQuaternion(orientation);
            transformationMatrix *= Matrix.CreateTranslation(center);

            // Update Cones
            redLine.Transform.LocalMatrix = Matrix.Identity;
            redLine.Transform.Rotate(new Vector3(0, -90, 0));
            redLine.Transform.LocalMatrix = redLine.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(redLine, Color.Red);

            greenLine.Transform.LocalMatrix = Matrix.Identity;
            greenLine.Transform.Rotate(new Vector3(90, 0, 0));
            greenLine.Transform.LocalMatrix = greenLine.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(greenLine, new Color(0, 255, 0)); // Color.Green is not 0, 255, 0

            blueLine.Transform.LocalMatrix = Matrix.Identity;
            blueLine.Transform.LocalMatrix = blueLine.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(blueLine, Color.Blue);
        } // RenderGizmoForPicker
        } // Update

        #endregion

        #region Render Gizmo For Picker

        /// <summary>
        /// Render the gizmo to the picker.
        /// </summary>
        private void RenderGizmoForPicker(GameObject3D gizmoCamera)
        {
            // Calculate the center, scale and orientation of the gizmo.
            Vector3    center;
            Quaternion orientation;
            float      scale;

            GizmoScaleCenterOrientation(selectedObject, gizmoCamera, out scale, out center, out orientation);

            // Calculate the gizmo matrix.
            Matrix transformationMatrix = Matrix.CreateScale(scale);

            transformationMatrix *= Matrix.CreateFromQuaternion(orientation);
            transformationMatrix *= Matrix.CreateTranslation(center);

            vertices[0] = Vector3.Transform(new Vector3(0, 0, 0), transformationMatrix);
            vertices[1] = Vector3.Transform(new Vector3(1, 0, 0), transformationMatrix);
            vertices[2] = Vector3.Transform(new Vector3(0, 1, 0), transformationMatrix);
            vertices[3] = Vector3.Transform(new Vector3(0, 0, 1), transformationMatrix);
            vertices[4] = Vector3.Transform(new Vector3(1, 1, 0), transformationMatrix);
            vertices[5] = Vector3.Transform(new Vector3(0, 1, 1), transformationMatrix);
            vertices[6] = Vector3.Transform(new Vector3(1, 0, 1), transformationMatrix);

            planeRedGreen.Transform.LocalMatrix  = transformationMatrix;
            planeGreenBlue.Transform.LocalMatrix = transformationMatrix;
            planeBlueRed.Transform.LocalMatrix   = transformationMatrix;
            Picker.RenderObjectToPicker(planeRedGreen, new Color(255, 255, 0));
            Picker.RenderObjectToPicker(planeGreenBlue, new Color(0, 255, 255));
            Picker.RenderObjectToPicker(planeBlueRed, new Color(255, 0, 255));
            // Render a second time but from the other side.
            planeRedGreenInv.Transform.LocalMatrix  = transformationMatrix;
            planeGreenBlueInv.Transform.LocalMatrix = transformationMatrix;
            planeBlueRedInv.Transform.LocalMatrix   = transformationMatrix;
            Picker.RenderObjectToPicker(planeRedGreenInv, new Color(255, 255, 0));
            Picker.RenderObjectToPicker(planeGreenBlueInv, new Color(0, 255, 255));
            Picker.RenderObjectToPicker(planeBlueRedInv, new Color(255, 0, 255));

            EngineManager.Device.Clear(ClearOptions.DepthBuffer, Color.White, 1, 0);
            // Update Axis Lines
            lines.LineRenderer.Vertices[0] = new VertexPositionColor(vertices[0], Color.Red);
            lines.LineRenderer.Vertices[1] = new VertexPositionColor(vertices[1], Color.Red);
            lines.LineRenderer.Vertices[2] = new VertexPositionColor(vertices[0], new Color(0, 255, 0));
            lines.LineRenderer.Vertices[3] = new VertexPositionColor(vertices[2], new Color(0, 255, 0));
            lines.LineRenderer.Vertices[4] = new VertexPositionColor(vertices[0], Color.Blue);
            lines.LineRenderer.Vertices[5] = new VertexPositionColor(vertices[3], Color.Blue);
            Picker.RenderObjectToPicker(lines);

            // Update Cones
            redCone.Transform.LocalMatrix   = Matrix.Identity;
            redCone.Transform.LocalPosition = new Vector3(1, 0, 0);
            redCone.Transform.Rotate(new Vector3(0, 0, -90));
            redCone.Transform.LocalMatrix = redCone.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(redCone, Color.Red);

            greenCone.Transform.LocalMatrix   = Matrix.Identity;
            greenCone.Transform.LocalPosition = new Vector3(0, 1, 0);
            greenCone.Transform.LocalMatrix   = greenCone.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(greenCone, new Color(0, 255, 0)); // Color.Green is not 0, 255, 0

            blueCone.Transform.LocalMatrix   = Matrix.Identity;
            blueCone.Transform.LocalPosition = new Vector3(0, 0, 1);
            blueCone.Transform.Rotate(new Vector3(90, 0, 0));
            blueCone.Transform.LocalMatrix = blueCone.Transform.LocalMatrix * transformationMatrix;
            Picker.RenderObjectToPicker(blueCone, Color.Blue);

            Vector3 screenPositions = EngineManager.Device.Viewport.Project(vertices[0], gizmoCamera.Camera.ProjectionMatrix, gizmoCamera.Camera.ViewMatrix, Matrix.Identity);

            planeAll.LineRenderer.Vertices[0] = new VertexPositionColor(new Vector3((int)screenPositions.X - RegionSize / 2, (int)screenPositions.Y - RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[1] = new VertexPositionColor(new Vector3((int)screenPositions.X + RegionSize / 2, (int)screenPositions.Y - RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[2] = new VertexPositionColor(new Vector3((int)screenPositions.X + RegionSize / 2, (int)screenPositions.Y - RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[3] = new VertexPositionColor(new Vector3((int)screenPositions.X + RegionSize / 2, (int)screenPositions.Y + RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[4] = new VertexPositionColor(new Vector3((int)screenPositions.X + RegionSize / 2, (int)screenPositions.Y + RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[5] = new VertexPositionColor(new Vector3((int)screenPositions.X - RegionSize / 2, (int)screenPositions.Y + RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[6] = new VertexPositionColor(new Vector3((int)screenPositions.X - RegionSize / 2, (int)screenPositions.Y + RegionSize / 2, 0), Color.White);
            planeAll.LineRenderer.Vertices[7] = new VertexPositionColor(new Vector3((int)screenPositions.X - RegionSize / 2, (int)screenPositions.Y - RegionSize / 2, 0), Color.White);
            Picker.RenderObjectToPicker(planeAll, Color.White);
        } // RenderGizmoForPicker