We are about to switch to a new forum software. Until then we have removed the registration on this forum.
point(width, height/2); does not appear in the Java applet window, nor does it appear in a saved raster image file, but it does appear (or half of it) as expected when outputted as a pdf. The same is also true for a default, (1 px) line as in, line(width, 0, width, height); I am running 2.0.3 on OSX v10.6.8
Answers
point() will create a single pixel at the x & y provided. So for a raster output, like your screen, or the saved image, the pixels are drawn inside the bounds of a pixel. but for the pdf, it is a vector object, so the pixels are drawn ON the bounds of the pixels.
for example, the point (0, 0) on screen is the top left pixel. but in vector, the point (0, 0) is the top left corner of the top left pixel.
hope this helps!
In drawing programmes, a stroke is usually painted centred to the spline.
Also, ellipse(0,0,0,0); maps to same dimension as point()
And ellipse(0,0,1,1); is twice the diameter of a point!
I think, there is something not quite right!
draws a rectangle that is width+1 x height+1 so that the right and bottom strokes are missing, (except when exported as a pdf).
Interesting.
Both ellipse(width/2,height/2,width,height); and ellipse(width/2,height/2, width-1,height-1); work in pdf, but in Processing/bitmap only ellipse(width/2,height/2, width-1,height-1); works without clipping.
Shurely, shome mishtake!
Is painted off centre, but
rect(width/2,height/2,width-1,height-1);
works!
Is this a feature or a bug?
"ellipse(0,0,1,1); is twice the diameter of a point!"
You should try without anti-aliasing: noSmooth().
I do not need to do that. Exporting as pdf does not 'add' anti-aliasing. What is the point, you are trying to make?
a point with antialiasing is larger than a pixel because neighbouring pixels are also affected to make the target point look better.
as for your original post - point(width, height/2); - this is offscreen when talking about screen pixels. screen is width pixels across, numbered 0 to width - 1. same with rect(0, 0, width, height).
A circle is symmetrical about its centre. ellipse(width/2,height/2,width-1,height-1); isn't symmetrical for a square canvas.
rounding errors?
...unless your size() parameter is an odd number. A circle is symmetrical about its centre. ellipse(width/2,height/2,width-1,height-1); isn't symmetrical for a square canvas e.g. size(200,200);