Log In  

Another update, I should probably do less but I'm bad at scheduling.

Cart #31827 | 2016-10-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


UP, DOWN --> Rotate
X,C --> Zoom
LEFT,RIGHT --> Particle Size
X&Z --> Effect ON/OFF

The effect is a bit wanky because it makes Z sorting kinda useless --> particles/region increases the deeper they get so they "overdraw" the trails of the ones that are above and more towards you.
This is not my effect, I took it from
NuSan's Trails example
I hope thats ok.

I would like to make a better effect but I'm kinda bad at stuff like that. tyroney already showed me another way which you can see here:
Tyroney's pixel tail
Sadly its a bit computation heavy, maybe I will find a way to use it.

I made the velocity of the particles on the y axis increase the lower they get. z is coming out of the screen, x is to the right.

I'm probably going to implement a function that lets you choose how many particles you want to use.

What I would like to do is to get away from geometry and make all this happen using physics. Gravitation wouldn't be the problem, Hydrodynamics will be :(
Optimizations regarding particles/region. Draw less when there are more in one place. Maybe only draw the ones that you can actually see but this would get extremely complicated I guess.
I should create a function that takes 4 different vortex states with an offset of 3 or 4 cycles between them, then draw a shape over these 4 coordinates. This way I could create a tail and could overcome some problems but it seems complicated too.

If you stare for too long, you will loose connection to the world.

Hey humans,

this is an update for the "water swirl"

Cart #31769 | 2016-10-25 | Code ▽ | Embed ▽ | No License

I wanted to make it a water swirl/vortex but it ended up looking more like stars getting sucked into a black hole.
It's just like a procedurally generated geometry based animation.
Rotate with up, down, zoom with x,c.

If anyone knows how I could make it look more like this or if someone got ideas/suggestions,
Water swirl simulation
then feel free to tell me.

I was thinking about maybe embedding the swirl into pixel art. I don't really have any use for it.

I just like swirls. They're magic.

Even older

Cart #30634 | 2016-10-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Hi there,
this is the second version. Its now infinite, i guess.
I added colors but I'm not to happy about how the colors are selected. It's still too strict there needs to be more fuzzyness about the color selection.
Sadly the more I'm adding the more I have to drop down the number of nodes.
Yellow ones are hit by sunlight...

Up, Down: Rotate around X-Axis
X, C (X, Z wtf I don't know which keyboard layout you have): Zoom

if you zoom out a little bit you could imagine a happy tiny little vortex :]

Still todo:
Do some sorting
Make it look better
Maybe an tale like effect for every point. (Does anybody know how to do this?)

Maybe fully switch to fluid dynamics, Pico8 would explode :D


Cart #30586 | 2016-10-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Hey guys,

this is just a simple project I started to make. In the end this should look like a vortex as you would expect it in water. White pixels at the top blue and darker blue ones deep down.

It's fully 3D but you can't rotate it while it's animating. There is a variable called Vortex_Animation. Turn it to false and you can rotate this thing with the arrow keys.

I have created a 3D surface that looks like the one you are seeing and put it in parameter form. This would let me create points with simply 2 parameters (U,V) that are random. I create around 1000 points in a for loop and save them.

In update these points get accessed again and a new position for every point is calculated.

Things i have to do:

  1. delete points when out of sight, create new ones to make it infinite
  2. slow down everything
  3. add some colors
  4. fix bad 3D implementation

I could use some help with points 2 and 4. I don't now how to slow down. I would like it to get processed every second or third update call.
Regarding 4, because of the surfaces geometric formula the shape is drawn laying with wrong rotation. As I'm not used to 3D stuff I don't know how this is done but as it is now I have to rotate every point in place after they were updated because the formulas for X,Y ans Z would again present the vortex at a weird angle using the parameters U and V. And because I am updating the points with the same formulas I again have to rotate them back in place, but maybe I should just stick with it.

Best thing would be to "rotate" the formulas itself so you simply had to fill in U and V. No I have to rerotate everything after calculation of X,Y and Z.
Or to implement a system that rotates everything once and then kinda stays there but..

I hope you have fun.

P#30587 2016-10-10 18:14 ( Edited 2016-10-26 19:36)

Zoorp ! And they're all gone. :) Maybe have the (Z) key to reset or bring them back ?

Looking at your update, reminds me a bit of the opening to BLACK HOLE by Disney.


P#30597 2016-10-10 21:13 ( Edited 2016-10-11 14:48)

At first I thought it was just 3D-looking 2D and then I noticed the controls and woah!!

So yeah very very good vortex! To get something closer to the video you're linking, I think making the little lines longer (like 8 times longer) could help maybe! It does look really cool as it is, great job!

P#31770 2016-10-25 18:26 ( Edited 2016-10-25 22:26)

Two observations re: looking more water like - I believe vortices tend toward faster nearer the middle. Also a more visually uniform distribution of dots might help.

edit:uniform as in 8 dots at the outside are way spread out, 8 dots near the middle are a solid band. Way more dots are needed towards the edges to look more surface like.

P#31794 2016-10-26 02:43 ( Edited 2016-10-26 16:40)

Former versions looked more clean because I had the particles created on a shape with thickness 1. However as nature isn't exact I added some range the particles could be created in to add some thickness.

P#31820 2016-10-26 09:13 ( Edited 2016-10-26 13:13)

isn't your z-sorting backwards? lighter particles seem drawn before darker ones. also I'm not sure about the dissolution effect, seems big (visible crosses) and fades to black when you'd need to kind of fill the screen with trails...

P#31830 2016-10-26 12:57 ( Edited 2016-10-26 16:57)

"isn't your z-sorting backwards?"

Well I implemented coloring in a way that there isn't a visible border between colors. The borders are diffuse. So this could be misleading maybe.
Z is coming out of the screen. So I draw the ones with the lowest Z first and the ones towards the screen later. It should be ok. I guess.

At least it has the same same sorting implementation as this version. If you zoom out and rotate around you see that it's working.

Cart #30755 | 2016-10-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

But it seems you are right. The latest version draws 4 tables holding the actual and the last three states. Seems like sorting of the latter tables doesn't work. If you look closely with the effect turned off, you can see that some particles of a 4 pixel line are sometimes disappearing when they rotate in front of the deeper ones.
Thank you for that!

Moreover problems occur when you use the effect or increase the size.

"also I'm not sure about the dissolution effect, seems big (visible crosses) and fades to black when you'd need to kind of fill the screen with trails..."

Yeah thats what I'm unhappy with. Another problem is that the deeper particles always overdraw the trails of the higher ones so I'm absolutely not happy with that.

As I explained a few times all particles x and y are stored in a table along with u and v. U and V are the parameters the formulas for x and y take. So animating works like this.
Rand(u) Rand(v) --> pass these to get x and y, store them.
Next cycle I just take u and v decrease them about some amount (amount is bigger when particles are "deeper") and recalculate x and y. So It's not that the whole shape is rotating, they actually move.

Best thing would be to store 4 different positions of the same particle. Every position about 4 cycles away from the last and then drawing a "drop" like shape around them connecting the first with the last. However I'm not sure how much different positions I would need to prevent an edgy look.
I would like to generate some kind of shape instead of having just a line.
I also can't just create infinite long lines by not clearing the screen due to the lack of colors the result would just be a big mess.
So I think a shape function and a good sorting algorithm should to the trick. But the shape drawing will be quite cpu intensive I think....

Last problem, I'm also a bad programmer ;)

I don't know...

P#31831 2016-10-26 13:32 ( Edited 2016-10-26 17:52)

had a quick look at the code, it seems you're drawing vortices backwards. older (pixel) particles get drawn on top of recent ones (discs). that's what I took for bad z-sorting. if vortex_4 is older it should be drawn first, vortex last.

also since you're not using sprite memory you can use it as a full backbuffer: memcpy(0,0x6000,0x2000). though I don't think you need it at all: just start with if (effect==false) cls() in draw() instead!

P#31838 2016-10-26 15:36 ( Edited 2016-10-26 19:36)

[Please log in to post a comment]