Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   DelphiGL LocalMatrix (https://www.delphipraxis.net/205977-delphigl-localmatrix.html)

mael 5. Nov 2020 21:06

DelphiGL LocalMatrix
 
Hallo,

DelphiGL transformiert ja Punkte vom Objekt-Koordinaten zu Weltkoordinaten mit Hilfe der LocalMatrix.
Diese wird in TGLBaseSceneObject.RebuildMatrix erstellt.

Delphi-Quellcode:
procedure TGLBaseSceneObject.RebuildMatrix;
begin
  if ocTransformation in Changes then
  begin
    VectorScale(LeftVector, Scale.X, FLocalMatrix^.X);
    VectorScale(FUp.AsVector, Scale.Y, FLocalMatrix^.Y);
    VectorScale(FDirection.AsVector, Scale.Z, FLocalMatrix^.Z);
    SetVector(FLocalMatrix^.W, FPosition.AsVector);
    Exclude(FChanges, ocTransformation);
    Include(FChanges, ocAbsoluteMatrix);
    Include(FChanges, ocInvAbsoluteMatrix);
  end;
end;
Da laut DelphiGL OpenGL ein rechtshändiges Koordinatensystem verwendet (was auch auf anderen Seiten bestätigt wird), wundere ich mich dass der erste Vektor im obigen Code LeftVector, und nicht RightVector ist.

Schaut man sich den Code von LeftVector an:
Delphi-Quellcode:
function TGLBaseSceneObject.LeftVector: TVector;
begin
  Result := VectorCrossProduct(FUp.AsVector, FDirection.AsVector);
end;
tut er was man erwarten würde, um eine korrekte Transformationsmatrix zu erstellen (von Objektkoordinaten zu Eltern/Weltkoordinaten).

Allerdings berechnet LeftVector die positive X-Achse die in Richtung rechts zeigt, also warum wird er LeftVector genannt? Namensfehler?


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz