0

我想画不同的颜色,这是我的代码:

//  Red
Mesh1->Data->IndexBuffer->Length = 6;
Mesh1->Data->VertexBuffer->Length = 6;
Mesh1->Data->VertexBuffer->Vertices[0] = TPoint3D(0,0,1);
Mesh1->Data->VertexBuffer->Vertices[1] = TPoint3D(1,0,0);
Mesh1->Data->VertexBuffer->Vertices[2] = TPoint3D(0,1,0);
Mesh1->Data->IndexBuffer->Indices[0] = 0;
Mesh1->Data->IndexBuffer->Indices[1] = 1;
Mesh1->Data->IndexBuffer->Indices[2] = 2;
//  Green
Mesh1->Data->VertexBuffer->Vertices[3] = TPoint3D(5,0,1);
Mesh1->Data->VertexBuffer->Vertices[4] = TPoint3D(6,0,0);
Mesh1->Data->VertexBuffer->Vertices[5] = TPoint3D(5,1,0);
Mesh1->Data->IndexBuffer->Indices[3] = 3;
Mesh1->Data->IndexBuffer->Indices[4] = 4;
Mesh1->Data->IndexBuffer->Indices[5] = 5;

我该怎么办?它必须使用彩色地图吗?就像:

http://edn.embarcadero.com/article/42114

而 TMesh 对象有 4 个颜色属性:

Mesh1->Data->VertexBuffer->Color0
Mesh1->Data->VertexBuffer->Color1
Mesh1->Data->VertexBuffer->Color2
Mesh1->Data->VertexBuffer->Color3

这是什么意思?如何使用它?

4

0 回答 0