Exemplo n.º 1
0
        public Viewer(Workspace workspace)
        {
            if (workspace == null) throw new ArgumentNullException("workspace");
            this.workspace = workspace;

            graphicsDevice = workspace.GraphicsDevice;

            CameraView = new ChaseView
            {
                Distance = 3.5f,
                Angle = new Vector2(-MathHelper.PiOver4 * 0.5f, MathHelper.PiOver4)
            };

            CurrentView = CameraView;
            viewMode = ViewMode.Camera;

            Projection = new PerspectiveFov
            {
                NearPlaneDistance = 0.01f,
                FarPlaneDistance = 10
            };

            DirectionalLightModel0 = new DirectionalLightModel
            {
                Enabled = true,
                DiffuseColor = Vector3.One
            };
            DirectionalLightModel1 = new DirectionalLightModel { Enabled = false };
            DirectionalLightModel2 = new DirectionalLightModel { Enabled = false };

            AmbientLightColor = new Vector3(0.05333332f, 0.09882354f, 0.1819608f);

            CameraMoveScale = 0.05f;
        }
Exemplo n.º 2
0
        void SetDirectionalLight(DirectionalLightModel model, DirectionalLight light)
        {
            light.Enabled = model.Enabled;

            if (model.Enabled)
            {
                light.Direction     = model.Direction;
                light.DiffuseColor  = model.DiffuseColor;
                light.SpecularColor = model.SpecularColor;
            }
        }
Exemplo n.º 3
0
        public Viewer(Workspace workspace)
        {
            if (workspace == null)
            {
                throw new ArgumentNullException("workspace");
            }
            this.workspace = workspace;

            graphicsDevice = workspace.GraphicsDevice;

            CameraView = new ChaseView
            {
                Distance = 3.5f,
                Angle    = new Vector2(-MathHelper.PiOver4 * 0.5f, MathHelper.PiOver4)
            };

            CurrentView = CameraView;
            viewMode    = ViewMode.Camera;

            Projection = new PerspectiveFov
            {
                NearPlaneDistance = 0.01f,
                FarPlaneDistance  = 10
            };

            DirectionalLightModel0 = new DirectionalLightModel
            {
                Enabled      = true,
                DiffuseColor = Vector3.One
            };
            DirectionalLightModel1 = new DirectionalLightModel {
                Enabled = false
            };
            DirectionalLightModel2 = new DirectionalLightModel {
                Enabled = false
            };

            AmbientLightColor = new Vector3(0.05333332f, 0.09882354f, 0.1819608f);

            CameraMoveScale = 0.05f;
        }
Exemplo n.º 4
0
        void SetDirectionalLight(DirectionalLightModel model, DirectionalLight light)
        {
            light.Enabled = model.Enabled;

            if (model.Enabled)
            {
                light.Direction = model.Direction;
                light.DiffuseColor = model.DiffuseColor;
                light.SpecularColor = model.SpecularColor;
            }
        }