We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How do you find the center pixel?
Say I have the width set at an even number of pixels, 8.
Pixels going across pizel 0, pixel 1... to pixel 7.
I would think initially that to get to the centre, you'd say (8-1)/2 but this would be 3.5, and there's no pixel 3.5, so how would processing resolve this? Round up to pixel 4? And settle for an off-centre pixel?
Or should I say 8/4, instead of minusing 1 for the zero that gets counted?
Answers
Thanks so much for responding to what I was starting to think was just me being ocd pedantic.
So it's like the two center pixels become a double sized Center Pixel? If you coloured it with stroke(0), and then zoomed it to see the individual pixels with grid lines, there would be two coloured pixels?
size(800, 600);
Follow up question in the same vein:
Working with that pixel coordinate x=400 as the centre pixel coordinate in an even split, pixel399 on the left and pixel400 on the right, how does it work if I want to use this point as centre if I do something like rectMode (CENTER) with a width of 3 pixels. Which side gets the extra pixel?
Dunno the algorithm they use for rect() rendering when rectMode() is set to CENTER. :-??
Thanks. I thought I was missing something. Going through Learning Processing, but I wanted to figure this out before I moved on because I thought it might be important #:-S