예제 #1
0
파일: Ocean.cs 프로젝트: dzamkov/DUIP
        public override Figure GetScene(Figure Foreground, Camera Camera, View View)
        {
            double zoom = Camera.Zoom;

            double wash = Math.Min(1.0, Math.Max(0.0, (zoom + 2.0) / 10.0));
            Color topcol = Color.Mix(Color.RGB(0.3, 0.6, 0.7), Color.RGB(0.3, 0.5, 0.8), wash);
            Color botcol = Color.Mix(Color.RGB(0.1, 0.4, 0.6), Color.RGB(0.1, 0.3, 0.7), wash);
            Figure fig = MeshFigure.CreateQuad(
                new MeshVertex(View.TopLeft, topcol),
                new MeshVertex(View.TopRight, topcol),
                new MeshVertex(View.BottomLeft, botcol),
                new MeshVertex(View.BottomRight, botcol));

            foreach (Layer l in this._Layers)
            {
                double pg = (zoom - l.MinZoom) / (l.MaxZoom - l.MinZoom);
                if (pg > 0.0 && pg < 1.0)
                {
                    double op = pg * (1.0 - pg) * 4.0;
                    fig += new ModulatedFigure(Color.RGBA(1.0, 1.0, 1.0, op), l.Figure);
                }
            }
            fig += Foreground;
            return fig;
        }
예제 #2
0
파일: Ambience.cs 프로젝트: dzamkov/DUIP
 /// <summary>
 /// Gets the final scene to display when given the foreground scene, camera parameters and the view.
 /// </summary>
 public abstract Figure GetScene(Figure Foreground, Camera Camera, View View);
예제 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.MakeCurrent();

            this._Renderer = new Renderer();
            this._Renderer.Cache = new FileSystemRenderCache(Program.Cache["Render"]);
            this._Renderer.Initialize();
            SystemTypeface.Create = this._Renderer.CreateSystemTypeface;

            this._Probe = new Probe();
            this._InputContext = new InputContext(this._Probe);

            this._Camera = new Camera(new Point(0.0, 0.0), 1.0);
            this._Ambience = new OceanAmbience(Random.Default);
            this._World = new World(this._InputContext, new Theme());
            this._MakeView();

            Content testcontent = new EditorContent();
            this._World.Spawn(testcontent, Point.Origin);
        }