Exemplo n.º 1
0
        public void ParseGeometryLibrary_GeometryMeshTriangles_Input(XmlNode InputNode, Triangles CurrentTriangles)
        {
            Console.WriteLine("Entered TrianglesInputNode");
            TrianglesInput CurrentTrianglesInput = new TrianglesInput();

            for (int i = 0; i < InputNode.Attributes.Count; i++)
            {
                switch (InputNode.Attributes[i].Name)
                {
                case "offset":
                    CurrentTrianglesInput.mOffset = uint.Parse(InputNode.Attributes[i].Value);
                    break;

                case "semantic":
                    CurrentTrianglesInput.mSemantic = InputNode.Attributes[i].Value.ToString();
                    break;

                case "set":
                    // Ignored
                    break;

                case "source":
                    CurrentTrianglesInput.mSource = InputNode.Attributes[i].Value.ToString().Substring(1);
                    break;
                }
            }

            CurrentTriangles.mTriangleInputs.Add(CurrentTrianglesInput);
        }
Exemplo n.º 2
0
 public ObjParser(String path)
 {
     FloatArray floatArray = new FloatArray();
     TrianglesInput input = new TrianglesInput();
     TrianglesP triP = new TrianglesP();
     Source source = new Source();
     source.mFloatArray = floatArray;
     Triangles triangles = new Triangles();
     triangles.mTriangleInputs.Add(input);
     triangles.mTrianglesP = triP;
     Vertices vertices = new Vertices();
     Mesh mesh = new Mesh();
     mesh.mSources.Add(source);
     mesh.mTriangles.Add(triangles);
     mesh.mVertices = vertices;
     Geometry geometry = new Geometry();
     geometry.mMeshes.Add(mesh);
     mGeometryLibrary.mGeometries.Add(geometry);
 }
Exemplo n.º 3
0
        public ObjParser(String path)
        {
            FloatArray     floatArray = new FloatArray();
            TrianglesInput input      = new TrianglesInput();
            TrianglesP     triP       = new TrianglesP();
            Source         source     = new Source();

            source.mFloatArray = floatArray;
            Triangles triangles = new Triangles();

            triangles.mTriangleInputs.Add(input);
            triangles.mTrianglesP = triP;
            Vertices vertices = new Vertices();
            Mesh     mesh     = new Mesh();

            mesh.mSources.Add(source);
            mesh.mTriangles.Add(triangles);
            mesh.mVertices = vertices;
            Geometry geometry = new Geometry();

            geometry.mMeshes.Add(mesh);
            mGeometryLibrary.mGeometries.Add(geometry);
        }
Exemplo n.º 4
0
        public void ParseGeometryLibrary_GeometryMeshTriangles_Input(XmlNode InputNode, Triangles CurrentTriangles)
        {
            Console.WriteLine("Entered TrianglesInputNode");
            TrianglesInput CurrentTrianglesInput = new TrianglesInput();

            for (int i = 0; i < InputNode.Attributes.Count; i++)
            {
                switch(InputNode.Attributes[i].Name)
                {
                    case "offset":
                        CurrentTrianglesInput.mOffset = uint.Parse(InputNode.Attributes[i].Value);
                        break;
                    case "semantic":
                        CurrentTrianglesInput.mSemantic = InputNode.Attributes[i].Value.ToString();
                        break;
                    case "set":
                        // Ignored
                        break;
                    case "source":
                        CurrentTrianglesInput.mSource = InputNode.Attributes[i].Value.ToString().Substring(1);
                        break;
                }
            }

            CurrentTriangles.mTriangleInputs.Add(CurrentTrianglesInput);
        }