PDA

View Full Version : 3D math functions



User137
11-02-2010, 09:30 PM
Anyone know of place to find ready source code for the usual math functions? In need of dglOpenGL compatible matrix functions, multiplication, forming by different vectors etc. Unit i used on Delphi had most functions in asm so it won't convert well to free pascal. This would be loads of work doing from scratch...

Brainer
12-02-2010, 04:21 AM
Did you try the one that comes with GLScene? (VectorGeometry.pas)

User137
12-02-2010, 09:02 AM
No i think 1 came with dglOpengl xx(

Well GLScene one seem to be very good start but propably won't do as it is. From the basics i use vectors with 3 dimensions, not 4. This is for 1 part speed and other for memory lineup in arrays.

Brainer
12-02-2010, 01:33 PM
Hm, check out the TAffineVector type. ;)

de_jean_7777
12-02-2010, 03:11 PM
I have been working on my own set of units for vector mathematics (and other mathematics stuff) for some time. I hope you can scavange something out of it. Everything is provided in the archive. I call it the VectorMachine (or more rednecky VektorMasheeeen).

The included vm.txt file has more details.

http://www.megaupload.com/?d=E5IMBYTM