I want to use processing to complete the following effect, which is to copy a picture and deform it to make it ring.But I don’t know how to turn the image into a fan shape.
The general method of operation should be as follows
1. Import PNG images
2. Turn the image into a fan shape (here I thought of using polar coordinates)
3. Use rotate() to combine into a ring
Or the second method
1. Import SVG images
2. Make the SVG vertex into a fan shape
3.rotate()
I think the key is how to turn the picture into a fan shape, so is there a way to get it done?
Here I create an image, and use it as a texture to draw 12 trapezoids using that texture. But if you draw more, smaller trapezoids , you can get it to look more like a ring.
Using the image you posted above I created an image of a vertical man and used that in the example sketch below. You can see this image inside the ring in the screen shot.
Rather than use a single shape (e.g. trapezoid) for the ring segment I have created a curved ring by considering the rectangular image (vertical man) as a number of horizontal slices then mapped these to the matching position in the ring.
Here is the output from my sketch using 11 ring segments and each segment made from 10 slices of the man image
This is a very good idea. I studied texture() and Vertex(), and then I tried to add vertex(), bezierVertex(), curveVertex(), quadraticVertex() between Vertex() and found the image Distorted directly LOL
However, random() may be used in my code, there may be 12 repeats, there may be two or even 3, 5, and 7, so I am still looking for a more suitable method.
thank you very much, though
Looking at the final result, I think it should be what I want to achieve, but for me as a beginner, I still don’t understand some of the codes. It may take an hour or two to study it. Thank you very much:)
The last parameter 10 is the number of slices simply increase this number until you get the smoothness you want e.g. drawRingSegment(img, 240, 50, segAngle, 30);
I have tried it. When nbrRingSegments is greater than 4, it looks like a circle, so I will try to maximize the last parametert.
You help me a lot, thank you very much:)