コード例 #1
0
 public Scene3D Convert(string vrmlPath)
 {
     try {
         var tokenizer = new Vrml97Tokenizer(File.Open(vrmlPath, FileMode.Open));
         var parser = new VrmlParser(tokenizer);
         var scene = new VrmlScene();
         parser.Parse(scene);
         return Convert(scene);
     } catch (Exception exc) {
         return null;
     }
 }
コード例 #2
0
 public Scene3D Convert(VrmlScene vrml)
 {
     Scene3D scene = new Scene3D();
     float[,] transformation = VrmlMath.GetUnitMatrix();
     foreach (Node node in vrml.root.children) {
         List<Object3D> objs = ConvertNode(node, transformation);
         foreach (Object3D obj in objs) {
             if (obj != null) {
                 if (obj is Shape3D) {
                     scene.Shapes.Add((Shape3D)obj);
                 }
             }
         }
     }
     return scene;
 }