我正在使用带有FMX的Delphi Seattle创建一个应用程序,并且正在直接自己创建网格。我不明白的是为什么这个网格没有出现:
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;
网格具有颜色材料,但是当我运行它时,网格不会出现。其他所有操作(多维数据集和网格)。
答案是将网格设置为TwoSide true,然后可以看到它。我确实尝试过旋转对象,但仍然看不到任何东西。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句