コード例 #1
0
ファイル: Viewport3D.cs プロジェクト: fxbit/FxGraphicsEngine
        public Viewport3D(Engine engine)
        {
            InitializeComponent();

            // save localy the graphic engine
            this.engine = engine;

            // set the first viewport
            RenderArea_Viewport = new GraphicsEngine.Core.Viewport(RenderArea.Width, RenderArea.Height, RenderArea.Handle, Format.R8G8B8A8_UNorm);
            ViewportManager.AddViewport(RenderArea_Viewport);

            // set the moving camera
            Engine.g_MoveCamera = RenderArea_Viewport.m_Camera;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: fxbit/FxGraphicsEngine
        private void start3d_Click(object sender, EventArgs e)
        {
            if (!Engine.isEngineRunning)
            {

                UISettings settings = new UISettings();

                if (settings.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {

                    // init the engine
                    //engine = new Engine(RenderArea.Width, RenderArea.Height, RenderArea.Handle, this.Handle);
                    engine = new Engine(1680, 1050, this);

                    // set the first viewport
                    RenderArea_Viewport = new GraphicsEngine.Core.Viewport(RenderArea.Width, RenderArea.Height, RenderArea.Handle, Format.R8G8B8A8_UNorm);
                    ViewportManager.AddViewport(RenderArea_Viewport);
                    /*
                    // set the second viewport
                    RenderArea_Viewport2 = new GraphicsEngine.Core.Viewport(RenderArea2.Width, RenderArea2.Height, RenderArea2.Handle, Format.R8G8B8A8_UNorm);
                    ViewportManager.AddViewport(RenderArea_Viewport2);
                    */
                    // set the moving camera
                    Engine.g_MoveCamera = RenderArea_Viewport.m_Camera;

                    // setup the input
                    engine.SetupInput(this);

                    // start the render
                    engine.StartRender();
                }
            }
        }
コード例 #3
0
 public static void RemoveViewport(Viewport viewport)
 {
     ListOfViewport.Remove(viewport);
 }
コード例 #4
0
        public KinectV2Form(Engine engine)
        {
            InitializeComponent();

#if false
            // save localy the graphic engine
            this.engine = engine;

            // set the first viewport
            RenderArea_Viewport = new GraphicsEngine.Core.Viewport(RenderArea.Width, RenderArea.Height, RenderArea.Handle, Format.R8G8B8A8_UNorm);
            ViewportManager.AddViewport(RenderArea_Viewport);

            // set the moving camera
            Engine.g_MoveCamera = RenderArea_Viewport.m_Camera;
#endif 

            // allocate the Matrix
            colorImageMatrix = new FxMatrixF(640, 480);
            depthImageMatrix = new FxMatrixF(640, 480);
            depthImageMatrixAve = new FxMatrixF(640, 480);

            // create a new image element
            colorImageElement = new ImageElement(colorImageMatrix);
            depthImageElement = new ImageElement(depthImageMatrix);

            canvas1.AddElement(colorImageElement, false);
            canvas1.AddElement(depthImageElement, false);
        }
コード例 #5
0
 public static void AddViewport(Viewport viewport)
 {
     ListOfViewport.Add(viewport);
 }