示例#1
0
        Rhino.Geometry.Mesh ConvertPrimtive(glTFLoader.Schema.MeshPrimitive primitive)
        {
            Rhino.Geometry.Mesh rhinoMesh = new Rhino.Geometry.Mesh();

            if (!AttemptConvertVerticesAndIndices(primitive, rhinoMesh)) //Only part that is required
            {
                return(null);
            }

            if (!AttemptConvertNormals(primitive, rhinoMesh))
            {
                rhinoMesh.RebuildNormals();
            }

            AttemptConvertTextureCoordinates(primitive, rhinoMesh);

            AttemptConvertVertexColors(primitive, rhinoMesh);

            return(rhinoMesh);
        }