lets say,
my desired output image is composed of 400 pixels
I have stored all necessary informations of these pixels in an array[20][20].
Now I want to setup a circular boundary. If a pixel fall in the boundary,it should be drawn and otherwise not. How can I set and check this condition?
I want the center of the circle located at array[height/2][width/2] position.
Circle for checking boundary conditions
Started by udvat, Jun 18 2007 04:37 AM
2 replies to this topic
#1
Posted 18 June 2007 - 04:37 AM
#2
Posted 18 June 2007 - 04:45 AM
Take the vector from the circle center to the pixel, find its length, and compare that to the radius of the circle. If it's smaller, the point is inside the circle.
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 18 June 2007 - 01:24 PM
Or use another channel as a mask to decide per-pixel wether to draw or not. The circle would then be precomputed, or loaded from a file.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












