Share My Creation Cells - Animation

when 2 cells collide in the middle they will unite. as bigger the cell as slower it will move.
animation end when all cells are united

 

Attachments

  • cells.jar
    326.8 KB · Views: 320
  • cellsV2.jar
    326.8 KB · Views: 353

wonder

Expert
Licensed User
Longtime User
Hey Ilan!

It looks really cool but I can't really understand what's going on.
Are you simulating some kind of physical process or is it just digital art?

The framerate on my PC is really low... 8 FPS at best... Is it supposed to be this way?
 

ilan

Expert
Licensed User
Longtime User
Hey Ilan!

It looks really cool but I can't really understand what's going on.
Are you simulating some kind of physical process or is it just digital art?

The framerate on my PC is really low... 8 FPS at best... Is it supposed to be this way?

the reason for the low FPS is i create an array of all pixels in the screen (600*400=240.000)

and go through them in a loop do draw each pixel as needed (to get that effect) since it is a too large array i had to do it in step 4
so my array is now 15.000 big) and every frame i need to go over all pixels. this is not easy. on my pc i get around 25 FPS
i could make the step to 8 and like this increase the FPS and also get a nice Pixel Art Style.

it is just a nice animation not more then that.
 

ilan

Expert
Licensed User
Longtime User
- What version is you B4J?
- What version is you JDK?
- Is you JDK 32 or 64 bit?

b4j is 4.01

JDK is
32 or 64

where do i check it?

EDIT: jdk = jdk1.8.0_65 (i am updating now the jdk to see if i get better performance)
 

ilan

Expert
Licensed User
Longtime User
i have updated the jdk and b4j but performance has not increased much.

change the scale to 1 and you will see what i mean (scale 1 = full array (600*400 [240.000 pixels])
 

ilan

Expert
Licensed User
Longtime User
@wonder you can also play around with the colors

for ecample:

B4X:
For Each p As pixel In pixels
        Dim sum As Int = 0
        For Each cl As cell In celllist      
            Dim d As Int = distance(p.x,p.y,cl.x,cl.y)
            sum = sum + (500 * (cl.r/d))
            sum = Min(sum, 255)
        Next  
        p.color = fx.Colors.To32Bit(fx.Colors.RGB(sum,128,0)) 'HSLtoRGB(sum*5,sum*10,sum*0.8) '
  '...
 

wonder

Expert
Licensed User
Longtime User
maybe opengl would be really a nice addition for b4j
Yeaaaaaah.... Just imagine, making games in B4J (LibGDX style) and uploading them to Steam. Big money!!!

By the way, have a look at the difference:
 

ilan

Expert
Licensed User
Longtime User
on my pc i get the same result for the jar file as when you build the project. dont know why the jar file runs so slow on your pc. on mine it runs fast
 

ilan

Expert
Licensed User
Longtime User
you know what could be archived from this source? a nice blood animation where small blood particles falls into a dungeon. and with a little physic (magic) the animation could be very nice
 

ilan

Expert
Licensed User
Longtime User
i have uploaded a new jar that was build with the latest b4j and jdk, tell me if you get the same result
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…