View Full Version : 3D math functions

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...

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

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.

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

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.