Click to See Complete Forum and Search --> : Accurate drawing


plasmon
November 13th, 2003, 12:08 AM
The parameters involved in drawing functions like,

MoveTo, LineTo, Rectangle, Ellipse etc requires long integers.

While in physics simulation, it is often desired to work with

decimal values too. How can i cope with that.

Marc G
November 13th, 2003, 07:11 AM
If you need to use the Win32 API, then i think the best way to do is that internally you keep doubles everywhere (in all your calculations etc...), but when you want to draw something using moveto, lineto,... just round you internal decimal representation to the nearest integer.
If that's nog good enough, search for some subpixel accurate drawing routines or use OpenGL or DirectX to do the drawing with subpixel accuracy.

Deniz
November 25th, 2003, 07:43 PM
I'd go openGL or directX