Ejemplo n.º 1
0
        OglVertexArray create(Mesh mesh)
        {
            var meshVertices    = mesh.Select("v", "vn", "vt");
            var triangleIndices = mesh.GetTriangleIndices(string.Empty);
            var vertexArray     = new OglVertexArray().Init(
                option => option.SetAttribute(OglVertexAttributeType.Float3, OglVertexAttributeType.Float3, OglVertexAttributeType.Float2),
                builder =>
            {
                foreach (var v in meshVertices)
                {
                    builder.AddVertex(new List <ParamVector>(v).ConvertAll(e => (object)e.values));
                }
                builder.AddIndices(OglVertexArray.Primitive.Type.Triangles, triangleIndices);
            }
                );

            return(vertexArray);
        }
 public InitOption(OglVertexArray parent)
 {
     this.parent = parent;
 }
 public VertexDataBuilder(OglVertexArray parent)
 {
     this.parent = parent;
 }