コード例 #1
0
        public void Export_SimpleModel_ValidOutput()
        {
            string path = "temp.x3d";

            var runner = new CrossThreadTestRunner();
            runner.RunInSTA(
              delegate
              {
                  Console.WriteLine(Thread.CurrentThread.GetApartmentState());

                  var vp = new Viewport3D();
                  vp.Camera = CameraHelper.CreateDefaultCamera();
                  vp.Width = 1280;
                  vp.Height = 720;
                  vp.Children.Add(new DefaultLightsVisual3D());
                  var box = new BoxVisual3D();
                  box.UpdateModel();
                  vp.Children.Add(box);

                  using (var e = new X3DExporter(path))
                  {
                      e.Export(vp);
                  }
              });

            var result = Validate(path);
            Assert.IsNull(result, result);
        }
コード例 #2
0
        private static void ExportX3d(Viewport3D view, string fileName)
        {
            var e = new X3DExporter(fileName);

            e.Export(view);
            e.Close();
        }