Hi All,
I suspect this ma be a bug, but possibly only with physics. The local definitions should not be available to any of the other code , yet it runs for several cycles.
Bri_G
Hi All,
I suspect this ma be a bug, but possibly only with physics. The local definitions should not be available to any of the other code , yet it runs for several cycles.
Bri_G
Hi @littfass,
Iâm a newbie with Codea/Lua but I like a lot your project, because I want to use Codea for trying to simulate real world problems (if possible )
With regard to your âquick testâ, I canât explain (for the moment) the reason why it slows down when increasing the particle number, but I think one reason could be the way the fluid particles are âcreatedâ: at the screen-center and, due to interactions between them, they displace each other simultanously while they are created. Iâm not sure if youâve fixed that already, but I think, an improvement in the âcreationâ procedure could help⊠but I donât know it exactly
Greetings from Mexico,
Victor
Is not working :-((
error is
error: error: [string "function MPM:simulate ()..."]:199: attempt to index field '?' (a nil value)
Pausing playback
@littfass, just a tiny remark: the âcreationâ procedure in your âquick testâ creates 101 particles (instead of, e.g., 100); I mean, your initial index should be 1 instead of 0 in order to create your maximum number of items.
Edit: Iâve trying to figure out what could be wrong when playing with more than 200 particles, focusing for the moment on your quick test and with my scarce knowledge of Codea/Lua. It seems to me that the âcreationâ function isnât the main poblem, which begins to appear when tilting the ipad⊠It might be that the problem is the drawing ability of the device (computation-speed required for the drawing loop in your code for every frame)⊠:-? ~O)
Anyway, I attach here a short video from a similar simulation that I made: the âflowâ of perfectly elastic âfluid particlesâ inside a box, âapplyingâ a momentum in x-direction to them in order to start with an initial velocity. After that, they interact with a âsolid bodyâ (e.g. a cylinder) and the walls of the box.
http://www.youtube.com/watch?v=uX7VTicgRTY
Iâll attach my code here later, after âcleaning itâ, for the use of beginners like me.
Saludos desde México,
Victor ~O)
Uups⊠thought lists begin with an 0 index? that might solve my problems on the mpm though
If you are intersted, maybe you can do operations with the image, a wave ripple must be easy thought, you only have to change the colors info of an image using set and get with an image data structure, Check this simple JavaScript
http://badassjs.com/post/932217000/water-ripple-effect-in-canvas
can anyone code this? When I try, it crash becouse big number of dotsâŠ