South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Imagine if she has to do a vid on doom and how it was not 3d but "3d" and yes it was seriously bad hence the #2 cross...OMG, that was painful to watch. She is completely clueless about the history of that quake code. That idea loooong preceded quake. That code was copied from an existing reference implementation (not by ID software) with perhaps a change in the constant to better fit the range of inputs.
Also, anyone with a good understanding of floating point numbers and the Newton Raphson can see how it works.
Nooooooooooooo!@cguy brace yourself
"welcome to compchomp where we crack jokes in binary"
+10 points if you make it to the end.
@cguy brace yourself
"welcome to compchomp where we crack jokes in binary"
+10 points if you make it to the end.
I always lol when people see the combination of C code and bit hacks and think it is mystical hacking.
Bit hacks are really squarely in the domain of mathematics and I think the reason it perplexes a lot of people is the base 2 aspect throws them.
ie> 55 << 1 = 110 (or vice versa, basically a comma shift but in base 2), wouldn't really seem strange to you if we used base 2 in every day. I mean if I took 55 and added a zero at the end and it gave me 550 you wouldn't think it was magic.
Fast inverse square root, sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5F3759DF, is an algorithm that estimates 1⁄√x, the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number x in IEEE 754 floating-point format. This operation is used in digital signal processing to normalize a vector, i.e., scale it to length 1. For example, computer graphics programs use inverse square roots to compute angles of incidence and reflection for lighting and shading. The algorithm is best known for its implementation in 1999 in the source code of Quake III Arena, a first-person shooter video game that made heavy use of 3D graphics. The algorithm only started appearing on public forums such as Usenet in 2002 or 2003. At the time, it was generally computationally expensive to compute the reciprocal of a floating-point number, especially on a large scale; the fast inverse square root bypassed this step.
Bow down to my superior tolerance, I got 4 seconds in...I failed, i got 1 second in.