You'll need to derive from TCustomMesh
and override Render
to pass in you calculated vertices.
Start with a center and a radius and the points are as follows. Assuming the shape is constructed parallel to a plane and subsequently transformed. The following creates a vertical Hexagonal Prism (I have no IDE atm and no way of testing this!).
ClearPoints();
prismEnd := -1;
while prismEnd < 2 do
begin
Z := Center.Z + (prismEnd * length)
angle = 0;
AddPoint(0, 0, Z);
while angle < 360 do
begin
X := Center.X + (radius * Cos(DegToRad(angle)));
Y := Center.Y + (radius * Sin(DegToRad(angle)));
AddPoint(X, Y, Z);
Inc(angle, 60);
end;
Inc(prismEnd, 2);
end;
For the 6 values this creates the TexCoords should be
Tex X Tex Y
1 0.5
0.75 1
0.25 1
0 0.5
0.25 0
0.75 0
You'll need 24 Triangles to render this, which depending on your draw method could require up to 72 indices.
but that will depend on how you map your textures.
I found this link which has examples of inheriting and using TCustomMesh
This should in theory provide a shape such as
