I am happily playing around and trying to further the "
blob" example from Daniel Shiffman's Box2d library for Processing.
What I am trying to do is create two blobs that can interact(collide) with each other. I am able to easily create two different blob objects yet they seem to render on different layers and are not influenced by each other.
My latest experiment is delving into using the
boxwrap2d library. I have had, and have been attempting, an idea to create a custom physics object (see image) in which 4 circles are strung together by lines, which all have physics properties.
I am just wondering how I can create such lines that will work as physics objects that shrink and expand as the circles move.
In a way it is similar to using Distance Joints to constrain each circle, yet the lines that join the circles would work as physics objects, and interact with other shapes.
The reason for this is that I am wanting to, for example, using it to contain other objects, circles rects etc it can be picked up and bounced around the screen.
Just got this small problem I have been trying to work out.
I want to generate a pattern, in this example simple hatching lines, as a PGraphics obj and then mask them with a shape, currently a Rect, that is another PGraphics obj. I have been playing with blend() and a few things yet I haven't been able to get anything to work well.
Basically something to this likeness, is what I am trying to do:
I have been conducting a few experiments with the
fisica and
geomerative libraries to try and create rigid bodies that are infact made up of single characters of text. I first started by using plain jpegs, which if course just built a bounding box around the entire image, and then looked into SVG's but the examples given for SVG usage in fisica+geomerative seem to be very buggy and inconsistent, with the code executing fine, but no images appeared on the canvas and the error
Found invalid polygon, sides are too close to parallel.
Didn't add unusable polygon. Dumping vertices:
float xv[] = {-0.039218f,-0.039218f,-0.039218f,}; float yv[] = {0.412512f,0.111878f,0.412512f,}; Found invalid polygon, sides are too close to parallel.
continually returned.
As a small example I am basically trying to make a bounding box go around the contour of a character. Such as "A". So when added to a physics engine and say fall on it's side the diagonal of the A character would be touching the ground, and not simply appear to have been rotated 90 degrees.
I have tried searching around the forums, and openprocessing.org trying to gain an idea on how to achieve such a thing but to no avail.
If anyone would have any previous attempted or advice to get me started. Cheers.
I have this little animation here that animates in a looped seamless pattern. I have text, colored white, in the middle of the canvas that the looped shapes pass over. What I am trying to work out is when the white bars pass over the text it masks it to reveal the same text but black.
I have looked into PGraphics, PShape, and PImage, and it seems apparent that masking it only possible with a combination of PGraphics and PImage. Any ideas on how I could do this?
Here is a graphic example of what I'm trying to achieve.