Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
For the opengl examples i converted i wrote some new matrix functions, also i my glmodel i have some quaternion vector matrix math things. I think it would be nice to have vector/matrix math unit next to the dglopengl unit providing some basic vector/matrix math filling the gap that is caused by the depracted functionality in opengl3 and suppelement things that were not availeable in opengl (quaternions).
So my suggestion is that a community dglmath unit is made. I donate my math things for wat they are worth (personaly i think only the math functions in my openg3 examples are worthwile using, but they are not oop.).
So what should be in it and who is willing to maintain it?
Or is there already a good vector/matrix math lib availeable? If so where can i find it?
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Hmm … I think (hypothetically speaking, if this ever gets finished, you know) one should start off with the most basic things. Vector types (2f, 3f, 4f) and symmetrical matrices (2x2, 3x3, 4x4). And then the most often used operations (vector add, subtract, scaling, cross- and dot-product and component-wise multiplication, also matrix · vector and the operations between matrices). More advanced things could be the inversion of matrices and the whole quaternion-thing.
And I do not think that OOP is the best to use for this. Because with classes and objects, you always need to take care of the references and free the objects when you do not need them anymore. I would rather use records or arrays, where scope checks are made by the compiler.
When using FreePascal, one could also use the operator overloading mechanism to implement the vector and/or matrix operations. This could be realized in a separate include-file which is only parsed when the compiler is the fpc, to ensure that Delphi is not disturbed by the operator declarations.
greetings
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: Di Okt 03, 2006 14:07 Beiträge: 1277 Wohnort: Wien
Hi Noeska, I have made my own Math3D.pas, most of the things inside are tested. It consists only of procedures & functions and you can have it, if you want. And last not least there is the old <geometry.pas> of dglsdk which is practically a community mat lib. kind regards Traude
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Is the dglsdk also availeable in an other format then the .exe installer? E.g. in zip format. To be honest i did not bother to reinstall the dglsdk on my new pc. In the same line is geometry.pas availeable as a separate download just like dglopengl? How complete is it?
[EDIT] I downloaded the linux version of the dglsdk and looked at the geometry.pas, unfortunately it uses assembly code in it. [/EDIT]
@Traude: Does your math lib handle matrices as flat arrays so they can easily be transferred to opengl like i do in the opengl3 examples? The hardest thing was to make a proper normal matrix even with the help of the dgl wiki article.
Registriert: Di Okt 03, 2006 14:07 Beiträge: 1277 Wohnort: Wien
Yes. I work only with OpenGL and I do not use glTranslate/Rotate/Scale, I use only my own tools. I cannot guaratee that everything is allright, I can only say: I use it, and it seems to be OK. What I did not use so far is marked with "NOT YET TESTED", which occurs in the Quaternion section.
This is the type definition of my matrix data:
Code:
TStdVector4D =Record X,Y,Z,W: TFloat32;End;
TStdMatrix =Array[0..3]Of TStdVector4D;// Vectors are coloumns
Note: "TFloat32" is a Single
And here are the function/procedure headers of my lib:
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.