Why doesn’t my mesh appear?

  

I’m creating an application with Delphi Seattle with FMX, and I’m working with creating meshes directly myself. What I don’t understand is why this mesh doesn’t appear:

Mesh.Data.VertexBuffer.Length := 4;
Mesh.Data.IndexBuffer.Length := 6;

with Mesh.Data.VertexBuffer do
begin
Vertices[0] := TPoint3D.Create( 1, 1, 0);
Vertices[1] := TPoint3D.Create( 1, -1, 0);
Vertices[2] := TPoint3D.Create(-1, -1, 0);
Vertices[3] := TPoint3D.Create(-1, 1, 0);

TexCoord0[0] := TPointF.Create(0, 1);
TexCoord0[1] := TPointF.Create(0, 1);
TexCoord0[2] := TPointF.Create(0, 1);
TexCoord0[3] := TPointF.Create(0, 1);
end;

with Mesh.Data.IndexBuffer do
begin
Indices[0] := 0;
Indices[1] := 1;
Indices[2] := 2;

Indices[3] := 2;
Indices[4] := 3;
Indices[5] := 0;
end;

The mesh has a colour material however when I run it, the mesh does not appear. Everything else does (a cube and a grid).

Comments are closed.