Hello

Hello,

How can I draw a gradient shape with FMX ? I've tried this but the triangel is red.

the wiki about TVertexFormat is just wrong and useless
http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.Types3D.TVertexFormat

procedure TForm1.Form3DRender(Sender: TObject; Context: TContext3D);
var
V: TVertexBuffer;
I: TIndexBuffer;
begin
V := TVertexBuffer.Create([TVertexFormat.Vertex, TVertexFormat.Color0], 3);
V.Vertices[0] := TPoint3D.Create(-10, -10, 0);
V.Vertices[1] := TPoint3D.Create(+10, -10, 0);
V.Vertices[2] := TPoint3D.Create( 0, +10, 0);
V.Color0[0] := TAlphaColorRec.Blue;
V.Color0[1] := TAlphaColorRec.Blue;
V.Color0[2] := TAlphaColorRec.Green;
I := TIndexBuffer.Create(3, TIndexFormat.UInt32);
I.Indices[0] := 0;
I.Indices[1] := 1;
I.Indices[2] := 2;
Context.DrawTriangles(V, I, nil, 1);
V.Free;
I.Free;
end;

Comments