コード例 #1
2
        private void Create3DViewPort()
        {
            var hvp3d = new HelixViewport3D();
            Viewport3D vp3d = new Viewport3D();
            var lights = new DefaultLights();
            var tp = new Teapot();

            hvp3d.Children.Add(lights);
            hvp3d.Children.Add(tp);

            vp3d = hvp3d.Viewport;
            tata.Children.Add(vp3d); // comenter ca pour test

            /* MEGA TEST DE L'ESPACE SUBSAHARIEN */

            RenderTargetBitmap bmp = new RenderTargetBitmap(800, 800, 96, 96, PixelFormats.Pbgra32);
            var rect = new Rect(0, 0, 800, 800);
            vp3d.Measure(new Size(800, 800));
            vp3d.Arrange(rect);
            vp3d.InvalidateVisual();
            
            bmp.Render(vp3d);

            PngBitmapEncoder png = new PngBitmapEncoder();
            png.Frames.Add(BitmapFrame.Create(bmp));

            String filepath = "C:\\Users\\Remi\\Desktop\\canardmasque.png";
            using (Stream stm = File.Create(filepath))
            {
                png.Save(stm);
            }
        }
コード例 #2
0
ファイル: ViewController.cs プロジェクト: cokemal/IfcEngineCS
 private void InitModel()
 {
     Vector3D center = new Vector3D((_minCorner[0] + _maxCorner[0]) / 2.0, (_minCorner[1] + _maxCorner[1]) / 2.0, (_minCorner[2] + _maxCorner[2]) / 2.0);
     hVp3D.Children.Clear();
     var lights = new DefaultLights();
     hVp3D.Children.Add(lights);
     CreateMeshes(center);
     CreateWireframes(center);
     var bound = hVp3D.Children.FindBounds();
     hVp3D.ZoomExtents(bound);
 }
コード例 #3
0
ファイル: ViewController.cs プロジェクト: cokemal/IfcEngineCS
        public void InitGraphics(Control destControl, TreeView destTreeControl)
        {
            _destControl = destControl;
            _treeControl = destTreeControl;
            hVp3D = new HelixViewport3D();
            var host = new ElementHost();
            host.Dock = DockStyle.Fill;
            host.Child = hVp3D;
            _destControl.Controls.Add(host);

            BindMouseHandler();

            var lights = new DefaultLights();
            hVp3D.Children.Add(lights);

            var teaPot = new Teapot();
            hVp3D.Children.Add(teaPot);
        }