Hi All!! Any one have some expercience on Firemonkey 3D framework?

Hi All!! Any one have some expercience on Firemonkey 3D framework?

I think that Firemonkey 3D can be really faster than it can seems (i belive that the imports library for DAE and OBJ are not well written):

I tried to load a very complex model in DAE format (80Mb) and importing it in Firemonkey (Windows / Android /Mac ) it is very slow... but if you load the model and save it using this method (protected if you inherit the class you can call)

procedure TModel3D.WriteModel(Stream: TStream);

procedure Write(AStream: TStream);
var
i: Integer;
LLength: Word;
begin
LLength := Length(FMeshCollection);
AStream.WriteBuffer(LLength, 2);
for i := 0 to LLength - 1 do
begin
AStream.WriteComponent(FMeshCollection[i]);
end;
end;

begin
Write(Stream);
end;


it save the model in a second, and if you reload it in the same way it is fast like light

procedure TModel3D.ReadModel(Stream: TStream);

procedure Read(AStream: TStream);
var
I: Integer;
LLength: Word;
begin
Clear;
AStream.ReadBuffer(LLength, 2);
SetLength(FMeshCollection, LLength);
for I := 0 to LLength - 1 do
begin
FMeshCollection[I] := TMesh.Create(Self);
AStream.ReadComponent(FMeshCollection[i]);
end;
end;

begin
Read(Stream);
UpdateMeshCollection;
end;


Comments

  1. True, but in this case the difference is absolutely abnormal, from 10min to 3sec

    ReplyDelete
  2. I am having the same exact problem and very happy to find your post! So I can use these to functions to make a kind of import/export for FM memory stream model, that's it? I will try!! :)

    ReplyDelete

Post a Comment