Math Articles
Having enemies throw grenades or launch projectiles in games often requires some form of trajectory planning in order to find the best launch moment, speed and angle. This research paper proposes a novel and practical approximation of 2D and 3D trajectories with drag and wind, which allows for very efficient trajectory planning as shown through a number of included examples. Includes an open source Unity3D implementation and demonstration.
Using a virtual camera with a large FOV can cause objectionable distortion near the screen’s edges. This article introduces a novel barrel distortion post effect that may be used to reduce stretch in this case. The effect can be controlled through multiple tweakable parameters, and requires only 2 additional instruction slots of a post effect’s fragment shader.
The Bernoulli distribution can be generalized to support more than two discrete states, where each state’s probability is generated by linearly interpolating between two given extremes, evenly dividing the difference from one extreme to the other. This article describes the properties of this discrete staircase distribution, together with a method to generate random samples from it in constant time.
Mobile devices don’t always come with native support for fractional or real numbers and matching math functions. During the development of Razor, I found myself in need of a small, fast and reliable math library and created FPMath, a 16.16 fixed point math library for the J2ME (Java) platform. This library has now been released and can be downloaded freely.