Another update, I should probably do less but I'm bad at scheduling.
NEW CONTROLS:
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.
Future:
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.
ATTENTION!
If you stare for too long, you will loose connection to the world.
HISTORY OF VORTEX (Old stuff)
Hey humans,
this is an update for the "water swirl"
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
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...
Controls:
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
1840
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:
- delete points when out of sight, create new ones to make it infinite
- slow down everything
- add some colors
- 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..
LITTLE DO I KNOW.
I hope you have fun.
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.
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!
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.
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.
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...
"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.
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...
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!
[Please log in to post a comment]