
/! highly unstable experiments below! /!
so here’s an experiment using Box2D as an output for vectorized outlines.
what it does is it uses the previous post’s vectorize function, collects and renders the patches.
then when we click on a patch, it triangulates the simplified shape and includes it in a Box2D scene.
before you click beware:
it is very expensive CPU-wise + it may crash with complex objects.
You can click on the shapes above. then play around with them
I’ve locked some shapes that would be too big and cause the player to crash.
so we can already have lots of fun!
yet the funniest is probably the one below: The Flash plugin is required to view this object.
draw somethign then push the add to simulation button ^^
( rather draw small separated elements )
the good thing is that it can handle both concave and convex objects so that even if you draw a line, it will be included in the simulation :)
source code is so dirty I’m really ashame, I noticed there’s also a problem in the previous VectorShape class (in a getter).
I’ll try to clean up and fix soon.
enjoy :)
edit:on the previous article, Sakri left a comment saying he had ‘something in his sleeve’ :) somehow I knew it would be cool, little did I know it would be that cool ! great job!
I also atempted to implement the verlet integration to get flubby shapes, I couldn’t get it to work. he did :)
Philippe
on Jun 3rd, 2009
@ 8:54 pm:
Amazing!
I suppose you could do a severe simplification of the shape for physics simulation and animate the complex drawing.
rothrock
on Jun 3rd, 2009
@ 11:18 pm:
This is so cool. I found your site about a month ago or so and I love seeing all the stuff you are doing it is so interesting and gets me thinking.
On a small side note on the usability front. Quite often I find the page doesn’t render properly and the background shows through where the text is. Today I’m seeing the white background that should be behind the post below the post. It makes it really hard to read!
Benjamin
on Jun 4th, 2009
@ 10:37 am:
For someone bad in math you are finally better than I thought Nico! Haha just kidding, actually really nice job, I enjoy a lot. It makes me think of this kind of game http://www.crayonphysics.com/.
What do you mean by “triangulate” the shape? Can you display it? :-)
nicoptere
on Jun 4th, 2009
@ 3:00 pm:
thanks all for the kind words :)
@philippe: that’s definitely a sound idea !!! I’ll think about that.
@rothrock: I can’t figure out why the page display is so unreliable… anyway thanks for braving this inconvenients to read me :)
@benjamin: yup crayon physics is just a step away (I mean it).
especially when you think about the MouseGesture class by Foxy ^^ we could draw springs, sticks aso
about triangulation, I adressed it in a former post
dVyper
on Jul 23rd, 2009
@ 2:30 pm:
What a great post!!! I have to say this site is amazing. I have to agree on the point that the page renders weirdly – i think because you use emoticons, it messes up the layout of the text a LOT.
But otherwise keep up the good work!!!