How to turn an 8-point reflection into a 12-point reflection?
in
Programming Questions
•
3 months ago
Hi,
I've made a little sketch that draws a line of circles when the mouse is dragged, and reflects that line on seven more axes to create a reflective effect, like a kaleidoscope.
Here's the brush code:
- void circle_brush(float x, float y, float px, float py, float lineWidth)
- {
- strokeWeight(lineWidth);
- px=px;
- py=py;
- ellipse(x, y, px, py);
- ellipse(width/2+((width/2)-x), y, px, py);
- ellipse(x, height/2+((height/2)-y), px, py);
- ellipse(width/2+((width/2)-x), height/2+((height/2)-y), px, py);
- ellipse(width/2+((width/2)-y), width/2-((width/2)-x), px, py);
- ellipse(height/2-((height/2)-y), width/2-((width/2)-x), px, py);
- ellipse(width/2+((width/2)-y), height/2+((height/2)-x), px, py);
- ellipse(width/2-((width/2)-y), height/2+((height/2)-x), px, py);
- return;
- }
It's pretty cool, but I want to make this more interesting. I'd like to edit it so the line has a 12-point reflection, so instead of drawing square-based shapes it will draw hexagonal ones.
However, I don't really have any idea how to do this, and everything I do seems to destroy it. :)
Does anyone have any advice?
1