Показать сообщение отдельно
  #7  
Старый 25.08.2026, 08:26
lmikle lmikle вне форума
Модератор
 
Регистрация: 17.04.2008
Сообщения: 8,116
Версия Delphi: 7, XE3, 10.2
Репутация: 49089
По умолчанию

Вот что ИИ подсказывает:

this is a common GLScene gotcha when attaching objects to bones in an animated skeleton.

What’s happening in your case is:

Setting GLFreeForm1.Parent := Bone.Dummy works for static positioning or when the whole model moves.
But GLScene’s skeleton animation updates bone transforms internally — it doesn’t automatically update the Dummy or Parent hierarchy for attached objects.
So your FreeForm stays fixed relative to the actor’s origin unless you manually update it each frame.
✅ Correct way: Update the FreeForm’s transform every frame
You need to read the bone’s transformation matrix after animation is applied and apply it to your object.

Код:
procedure TForm1.GLSceneViewer1BeforeRender(Sender: TObject);
var
  Bone: TGLSkeletonBone;
  Mat: TMatrix;
begin
  Bone := GLActor1.Skeleton.BoneByName('RightHand'); // your bone name
  if Assigned(Bone) then
  begin
    // Get the bone's absolute transformation in world space
    Mat := Bone.GlobalMatrix;

    // Apply it to the FreeForm
    GLFreeForm1.Matrix := Mat;
  end;
end;
Ответить с цитированием