voilà qui corrige le pb
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
procedure TForm1.FormCreate(Sender: TObject);
var
Index: Integer;
P: TPointF;
begin
for Index := 0 to Model3D1.MeshCollection[0].Data.VertexBuffer.Length - 1 do
begin
P := Model3D1.MeshCollection[0].Data.VertexBuffer.TexCoord0[Index];
if P.X > 1 then
P.X := P.X - 1;
if P.Y > 1 then
P.Y := P.Y - 1;
Model3D1.MeshCollection[0].Data.VertexBuffer.TexCoord0[Index] := P;
end;
for Index := 0 to Model3D1.MeshCollection[1].Data.VertexBuffer.Length - 1 do
begin
P := Model3D1.MeshCollection[1].Data.VertexBuffer.TexCoord0[Index];
if P.X > 1 then
P.X := P.X - 1;
if P.Y > 1 then
P.Y := P.Y - 1;
Model3D1.MeshCollection[1].Data.VertexBuffer.TexCoord0[Index] := P;
end;
end; |
alors il semblerait que l'import modifie la valeur...
au départ j'ai voulu ajouter 1, mais en fait il faut retirer 1 pour les valeurs > 1
en mettant un point d'arrêt sur le premier point j'ai (0,294517993927002, 1,35914099216461) alors que le fichier contient (0.294518 -0.359141)
cela vient de ce code :)
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
procedure TGEVertexSource.SetTextue0Source(const ASource : TSingleDynArray; AStride: Integer = 2);
var
i , id: Integer;
begin
SetLength(FTexture0Source, Length(ASource) div AStride);
for i := 0 to High(FTexture0Source) do
begin
id := i * AStride;
FTexture0Source[i] := PointF( ASource[id + 0], 1 - ASource[id + 1]); // change y value to firemonkey coordinate
end;
end |