예제 #1
0
        public ScreenContext(Control owner, 行列管理 manager)
            : base()
        {
            // SwapChain の生成
            var d3ddevice  = RenderContext.Instance.DeviceManager.D3DDevice;
            var sampleDesc = new SampleDescription(1, 0);

            this.SwapChain = new SwapChain(RenderContext.Instance.DeviceManager.DXGIFactory, d3ddevice, getSwapChainDescription(owner, sampleDesc));

            //ラスタライザの設定

            //深度ステンシルバッファの初期化
            using (var depthBuffer = new Texture2D(d3ddevice, getDepthBufferTexture2DDescription(owner, sampleDesc)))
            {
                this.深度ステンシルビュー = new DepthStencilView(d3ddevice, depthBuffer);
            }
            //レンダーターゲットの初期化
            using (Texture2D renderTexture = Resource.FromSwapChain <Texture2D>(SwapChain, 0))
            {
                this.D3Dレンダーターゲットビュー = new RenderTargetView(d3ddevice, renderTexture);
            }

            // その他

            this.ワールド空間        = new ワールド空間();
            this.BindedControl = owner;
            this.行列管理          = manager;
            this.パネル監視         = new マウス監視(owner);
            this.ビューポートを設定する();
        }
예제 #2
0
        public 照明行列管理(行列管理 manager)
        {
            _行列管理 = manager;

            ビュー行列管理   = new カメラ(new Vector3(0, 0, -20), new Vector3(0, 0, 0), new Vector3(0, 1, 0));
            射影行列プロバイダ = new 射影();
        }
예제 #3
0
        private 行列管理 _行列を初期化する()
        {
            var 行列管理 = new 行列管理(
                new ワールド行列(),
                new カメラ(
                    カメラの初期位置: new Vector3(0f, 20f, -40f),
                    カメラの初期注視点: new Vector3(0f, 3f, 0f),
                    カメラの初期上方向ベクトル: new Vector3(0f, 1f, 0f)),
                new 射影()
                .射影行列を初期化する((float)Math.PI / 4f, 1.618f, 1, 2000));

            this.照明行列管理 = new 照明行列管理(行列管理);
            return(行列管理);
        }
예제 #4
0
        public ScreenContext ScreenContextを作成する(Control control)
        {
            var カメラ = new カメラ(
                カメラの初期位置: new Vector3(0, 20, -40),
                カメラの初期注視点: new Vector3(0, 3, 0),
                カメラの初期上方向ベクトル: new Vector3(0, 1, 0));

            var 射影行列 = new 射影();

            射影行列.射影行列を初期化する((float)Math.PI / 4f, 1.618f, 1, 200);

            var matrixManager = new 行列管理(new ワールド行列(), カメラ, 射影行列);

            var context = new ScreenContext(control, matrixManager);

            this.ControltoScreenContextマップ.Add(control, context);

            return(context);
        }