We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there,
Im wanting to make a pattern that would have a simple for loop repeating pattern. Im thinking of something that starts on one quadrant and finishes on another quadrant. For sake of discussion a triangle that morphs in to a square?
I saw this https://processing.org/examples/morph.html which helps me think about how to morph a shape, but not sure if the same rule would apply for wanting to make a pattern.
Generative Design has a similar sketch http://www.generative-gestaltung.de/P_2_1_2_03 but I do not need sketch to move, a still image is totally fine.
Any help is much appreciated!
Answers
Based on where a shape is drawn, make it more like a triangle or more like a square.
You know where the shape is going to be drawn, because you know where you're drawing it.
You might consider using the distance from (0,0) to where the shape is being drawn as the amount of how "like a square" your shape is. At (width,height), this would be 100% square (and thus 0% triangle). At (0,0), 100% triangle and 0% square.
Here's some example code. Understand it first:
Nice one @TfGuy44 & nice idea @jsr
Been playing with the original code but don't know PVector class well enough.
I'd meant to spend this evening sorting out a drum sequencer in arduino, but really liking Islamic art made this too interesting to miss.
Anyway, this is a simple tiling of code above:
But being able to morph between different shapes would be amazing - PVector looks to be the way to go, but how to deal with polygons of different numbers of sides - how to morph between a square and a triangle?
At least make it tile my shapes nice.
Here's one way:
Or, if you like:
That's really nice. Hadn't understood the morph_shape amt but good way of spreading change through the grid. I like the middle one most. Doesn't scale with change of tileDistance unless you use:
Is there a way of getting it between to morph between polygons of n sides?
edit - looks like this is how to draw polygon of n sides, next step to lerp betweeen vertices. not tested yet, so bound to have an error or two.
Not perfect, but this interpolates between 2 polygons of (different) n sides. Quite a complicated way of setting out spokes, then limiting the magnitude for those ones not needed, but used in interpolating the next shape.
Thanks for all the help everyone! This is definitely enough to get me started.