You might want to try using this geometry library I've written to go along
with OpenGL, fixed function or otherwise:

https://github.com/sysrpl/Bare.Game/blob/master/source/bare.geometry.pas#L317

Basic usage might be like this:

var
  M: TMatrix;
  V: TVertex;
begin
  M.Identity;
  M.Translate(10, 0, 0);
  V := M * Vec(10, 10, 10);
  M.Rotate(0, 10, 0);
  V := M * V;
  WriteLn('X: ', V.X, ' Y: ', V.Y, 'Z: ', V.Z)
  M.Scale(0.5, 0.5, 0.5);
  V := M * V;
  WriteLn('X: ', V.X, ' Y: ', V.Y, 'Z: ', V.Z)
end;

And these matrices are compatible with OpenGL functions.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to