We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have searched Processing and couldn't find any help in getting this effect done, see below: http://farm4.static.flickr.com/3818/11577359654_0f8ede8007_m.jpg
Ideally I would like to load 3 images from the camera and have them arranged in a collage, preferably not in a box collage, but with non-normal shape collage (ie. not circle, rectangle or square, see above image).
Loading from camera could come after, 3 images from the data folder and displayed in a collage similar to the above photo.
Any help or push in the right direction would be appreciated.
Answers
You can use mask() to cut out shapes, then just draw the results.
Can you give an example?
Remember the desired out come is this: http://farm4.static.flickr.com/3818/11577359654_0f8ede8007_m.jpg
I found this and I got a little closer: http://www.adamtindale.com/blog/processing/129/
How do I stop the 3 images from overlapping? I would like to be able to drag around each image in its own shaped block, keep in mine the desired outcome...
https://www.google.com/search?btnG=1&pws=0&q=mask()+site%3Aprocessing.org&gws_rd=ssl
I don't quite get the mask() but this is what I have so far:
I can easily change this to show an image as the background and then only show the rect and triangle mask.
This is for one image, suppose I want 3 images, in there own masked blocks...Is this possible with Processing?
Please look at this image: http://farm4.static.flickr.com/3818/11577359654_0f8ede8007_m.jpg
As you can see there are 3 images...
If I load 3 images in processing, they will overlap..how would I stop the overlap?
How can I give each image its own block...think of picmix or instacollage.
Yeah, you can stop linking to the same image over and over, we get the point. ;)
As said, mask() is an option, but I think this might even be easier with beginShape(), texture(), vertex() and endShape(). Make sure to understand and/or set the textureMode() and to supply texture coordinates in the vertex() calls. Then you can create three shapes just as you showed them, each using a different image as it's texture. As a general tip, there is Processing reference which explains all the available methods: http://www.processing.org/reference/
Thank!
Thanks amnon, your advice really helped.
But this maps the entire image as the texture, suppose I only want to map a portion of the image as the texture and then use the mouse to drag the image around within the Shape boundaries defined by the vertex, how would this work?
You can use the texture coordinates you want. Depending on the textureMode() they are either in terms of pixels or normalized (0-1). You can have any combination of vertex locations and vertex uv texture coordinates.
Cool, how about being able to drag the image/texture around within the vertices?
Maybe this can help.
http://processing.org/tutorials/pshape/
I will take a look into this.
and of course, as mentioned...
http://processing.org/reference/PShape.html
With all the PShape methods
and
http://processing.org/reference/texture_.html
Possible. Anywhere you have numbers in a sketch, you can always replace them by variables. Variables can then always be changed. By math, mouse events, etc.
This is what I came up with, just change the image to run:
}
Great! I haven't run this, but some suggestions from looking at your code:
Just some ideas... O:-)