Go to index of notes. ~ Go to home page.

Notes20#. Using Small Circles or Spheres in an Integer World.


When you have very small objects in an integer world then each pixel begins to matter for things like collision detection. For example if your object is a circle with a radius of, very roughly, 15 or more, you could choose not worry about how it is represented on screen and in your integer co-ordinate system.... but if you imagine of a circle with a radius of 2 then you'll see it's critical. In particular for circles and spheres the centres of them need to be considered. If yout think of every co-ordinate on your screen being represented by a pixel, then so must your circle centre -- which means all your circles must have a diameter that is an odd number of pixels. Or... if you decide that every co-ordinate on your screen is represented by the theoretical bottom left of pixels -- all your circle diameters must be even. The case of odd diameters is illustrated below.