[SDL] "Perfect" circles

David Olofson david at olofson.net
Wed Nov 8 07:13:35 PST 2006


On Wednesday 08 November 2006 15:26, Alan Wolfe wrote:
[...]
> Using the circle equation to draw circles doesn't give a perfect
> circle, it gives an ellipse.  The reason is because the pixels in
> your monitor themselves aren't perfect squares (unless you are on a
> Macintosh I believe).

This is true if you're using 1280x1024 on a standard 4:3 aspect ratio 
CRT monitor. In pretty much all other cases (including 1280x1280 
TFTs, which are not 4:3!), pixels *are* perfect squares, within the 
tolerances of linearity and whatnot on CRTs.

The bad news is that lots of people are using 1280x1024 instead of 
1280x960 on 4:3 CRTs. Meanwhile, there *are* 5:4 monitors (even CRTs, 
altough I think those are rare these days), so you cannot just assume 
that 1280x1024 means pixels are non-square.

The only chance of getting it right (on properly configured systems) 
would be to ask the system. I'm not sure there is a portable way of 
doing this. Maybe something that SDL could handle?


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'




More information about the SDL mailing list