123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|607|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Blitz 3D math source

Mon, 05 Dec 2011, 19:48
dna
I thought that some of you might miss this and so I posted it here.

It's from the internal guts of B3D



After viewing this it seems as though B3D would be easier to mod than imagined.

-=-=-
DNA
Mon, 05 Dec 2011, 23:26
Cower
How does a simple math library say anything about "modding" Blitz3D?
Tue, 06 Dec 2011, 09:22
Afr0
In theory this could be "modded" and compiled into a DLL that you could use with Blitz, but you wouldn't need this to do that.
The Doom 3 source also has a math library you could use with Blitz if you wanted to.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Tue, 06 Dec 2011, 16:10
JL235
Cower's point is that the maths library is only one small section, and it's quite generic. Pretty much any other 3D engine will have similar (for example PMC has it's own for the 2D gfx engine).
Tue, 06 Dec 2011, 19:59
Evil Roy Ferguso
I have to admit that my favorite part of this code is the fact that infinity is defined as 10 million.
Tue, 06 Dec 2011, 20:23
JL235
10 million isn't that strange of a choice. Due to the way that floating point numbers work, there is a limit on the smallest number you can add, and this is based on the size of the floating point number. For example 10000000000000000.0 + 1.0 is 10000000000000000.0.

With 10 million, the smallest number you can add is 0.000000002.

So if a larger value is allowed for the maximum number, then PI and other values that include a long series of decimals will begin to lose their accuracy.

or at least, that's my guess.
Wed, 07 Dec 2011, 20:49
Evil Roy Ferguso
@JL235 - I am aware of how floating point math works -- it's not that 10 million is an odd choice but that "infinity" is expressly given a finite value. I'd probably have to call it something more like "MAX_SIGNIFICANT_VALUE" if I wanted to be able to read my own code without giggling.
Thu, 08 Dec 2011, 18:53
dna
An Oxymoron of math.

Or Sorts.