[英]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. 我正在使用带有FMX的Delphi Seattle创建一个应用程序,并且正在直接自己创建网格。 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). 其他所有操作(多维数据集和网格)。
The answer is to set the mesh to TwoSide true, then I can see it. 答案是将网格设置为TwoSide true,然后可以看到它。 I did try rotating the object, but still couldn't see anything. 我确实尝试过旋转对象,但仍然看不到任何东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.