Add a display.newMetaball()

Hi Carlos,

I have been playing with the code and try to make a liquid simulation. As showed here http://developer.anscamobile.com/code/liquid-simulation-corona-sdk

The algorithm is easy and it should be fast but, after a tons of optimizations, it seems that the bottle neck is the fill() rutine which is like a flood fill algorithm adding display.newLines() objects and removing them each frame.

Could be a good idea to add something similar but inside Corona by creating a new display object:

display.newMetaball()

As you can see from my code, we just need a gray buffer to draw all blur balls in additive way, then use a threshold to make them full intensity. This will simulate the liquid as proven in my code.

But in a faster way if it’s inside the native Corona.

Thanks in advance and I hope to see this soon.

Emilio

[import]uid: 9975 topic_id: 17202 reply_id: 317202[/import]

I swear I read this as display.newMeatball()

Will bring up your request in our next meeting :slight_smile:

Peach [import]uid: 52491 topic_id: 17202 reply_id: 64942[/import]

i think a native fill on objects of arbitrary polygon shape is more accurate as per JIm Blinns’s paper on “A Generalization of Algebraic Surface Drawing” … which is where metaballs were borne. Which are after all, a representation of polynomials.

c
[import]uid: 24 topic_id: 17202 reply_id: 64955[/import]

great… now my brain hurts… [import]uid: 52430 topic_id: 17202 reply_id: 64967[/import]

i read meatBall also [import]uid: 7911 topic_id: 17202 reply_id: 64970[/import]

I would venture that those of you who read meatball, and not metaball, are young enough not to remember when metaballs were all the rage in computer graphics.

Metaballs of course gave way to metasurfaces and were implemented in 3DStudio release 4 (that’s the DOS version, if you don’t remember metaballs, you probably don’t remember DOS :slight_smile: ) by a spanish company Reyes Infografica.

If you do a Google image search for MetaReyes, you will find the promo images that had us all agog and dreaming of getting a hold of that plugin. The idea of modelling organic surfaces by laying out the underlying muscle structure, one muscle at a time, seemed absolutely mind bending, and was very appealing to those of us modeling characters poly by poly (might as well do it that way, we had a budget of 350 polys per character).

I digress…or my mind is wandering, it happens with age. [import]uid: 5317 topic_id: 17202 reply_id: 64989[/import]

Maybe I’m to old - and I’m not hungry right now - I’ve read MetaBall :wink:

+1 for the needed native basics [import]uid: 70114 topic_id: 17202 reply_id: 65015[/import]

Blinn’s paper is the defacto on MetaBalls representation.

His books on his “notes”, “Dirty Pixels” are awesome.

C. [import]uid: 24 topic_id: 17202 reply_id: 65113[/import]

+1 for newMeatBall [import]uid: 13632 topic_id: 17202 reply_id: 65116[/import]

@carlos Since eaguirre’s problem isn’t really metaballs or meatballs but Corona’s frame based physics implementation, can we get a comment on that? Last word on it from Danny was 3 weeks ago and I think there are a lot of us who would just like to know whether or not a time based physics implementation is being looked at/can be done/will be introduced in the future for CoronaSDK. Not trying to get you to divulge any trade secrets or anything :slight_smile: but if this is something that is not in Corona’s future we can save a lot of time by not developing things that won’t run on a device, such as eaguirre’s liquid simulation. Thanks. [import]uid: 40137 topic_id: 17202 reply_id: 65121[/import]

@mmathias6410 - that’s exactly what i was trying to say when what is really needed is a fill that works on polygons of arbitrary topology and that is something we can do internally (core).

c
[import]uid: 24 topic_id: 17202 reply_id: 65132[/import]

Cool!

Muchas gracias! Carlos :slight_smile: [import]uid: 9975 topic_id: 17202 reply_id: 65153[/import]

@carlos Sorry, I’m not smart enough to keep up:)

@eaguirre Have you tried removing the fill() routine completely and simply spawning your 200 balls/physics objects? If you test that on a device you will find the same frame rate lag you are experiencing now. Even if you get a fill that works on polygons of arbitrary topology, you cannot have 200 dynamic physics objects constantly colliding due to Corona’s current implementation of Box2D. People way smarter than me explain it here:

You can get away with maybe 30-40 dynamic physics objects constantly colliding if you have nothing else on screen, but that’s the end of the world. After that the performance hit makes any game unplayable. Good luck! [import]uid: 40137 topic_id: 17202 reply_id: 65238[/import]