Realistic Lava Lamp
6 posts • Page 1 of 1
Realistic Lava Lamp
Hopefully this is a pretty realistic lava lamp. Some weeks ago I opened up Algodoo and thought "Wouldn't it be cool if I made a lava lamp that actually works?", then I answered myself "Yeah that would be really cool!". It's taken me till this very day to make something that even resembles one.
Its pretty simple thyme but you might notice a few things (gravity is upside down, tracers as massless circles) that took a really long time for me to hit on.
Anyways:
Please Comment and Rate!
Its pretty simple thyme but you might notice a few things (gravity is upside down, tracers as massless circles) that took a really long time for me to hit on.
Anyways:
Please Comment and Rate!
- gmowebster
- Posts: 3
- Joined: Sat Sep 05, 2009 10:40 pm
Re: Realistic Lava Lamp
Yes, very cool.
I am sure this would be very difficult to script, but you could in theory dispense with the attraction and instead figure out some way to simulate surface tension. Maybe if one of the colliding circles is touching 5 or 6 other colliding geoms, it has a very weak attraction, if not, a weak repulsion. Or maybe not.
I guess that way, small globs would fly apart, which is not realistic.
Maybe you could reinvert gravity put a laser on each colliding circle and script the lasers so that
In other words, the circles would gradually get denser over time.
And put a box at the base that is scripted so:
And the circle would float again.
And find a better way of simulating surface tension.
And maybe figure out some way to prevent two globs from merging for a few seconds after one flops down onto another.
Again, you have built one very cool lava lamp.
I am sure this would be very difficult to script, but you could in theory dispense with the attraction and instead figure out some way to simulate surface tension. Maybe if one of the colliding circles is touching 5 or 6 other colliding geoms, it has a very weak attraction, if not, a weak repulsion. Or maybe not.
I guess that way, small globs would fly apart, which is not realistic.
Maybe you could reinvert gravity put a laser on each colliding circle and script the lasers so that
- Code: Select all
e.geom.density = e.geom.density - 0.0001
In other words, the circles would gradually get denser over time.
And put a box at the base that is scripted so:
- Code: Select all
e.other.density = 0.001
And the circle would float again.
And find a better way of simulating surface tension.
And maybe figure out some way to prevent two globs from merging for a few seconds after one flops down onto another.
Again, you have built one very cool lava lamp.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Realistic Lava Lamp
Thanks for the comments guys!
@Someone else: Unfortunately thyme can't tell how many objects something is colliding with but I'll definitely try out the lasers sometime.
@Someone else: Unfortunately thyme can't tell how many objects something is colliding with but I'll definitely try out the lasers sometime.
- gmowebster
- Posts: 3
- Joined: Sat Sep 05, 2009 10:40 pm
Re: Realistic Lava Lamp
Well, you clearly know a lot more about Thyme than I do.
If there was a way to tell when a geom begins to collide with another (when you drop a restitution = 0 ball on the floor) and also when this collision ceases (when you pick the ball up). This could be used to keep a count of the number of colliding geoms.
I don't know, but a Phun-friendly version of the laser thing might be able to be accomplished with a script using Sim.time. Maybe colliding with the "heated" box at the bottom of the lamp initiates a script that keeps track of the amount of time passed since initation. Maybe, on initiation, controllerAcc = sim.time, but then you need something to repeatedly check (sim.time - controllerAcc) / [a constant] and set density equal to that. Or will this script run continuously anyway because it uses sim.time? Or is there some other lagless way to repeatedly initiate a script without causing any unwanted forces? Lasers are the most efficient may I have thought up so far, but...
Another interesting property of real lava lamps is that the wax stuff can freeze. Maybe you could simulate this by having a very high friction and exponentially increasing inertiaMultiplier. You know, inertiaMultiplier = inertiaMultiplier * 2. And also a very weak attraction so the balls are less likely to slip off each other with +inf inertiaMultiplier.
I just realized that my code for the laser is wrong. I had:
which should be:
The intention is it gradually INCREASE density over time.
Sorry about the mistake.
Oh, and with the lasers, the circles should have maximum opacity. In the off chance that wasn't obvious.
If there was a way to tell when a geom begins to collide with another (when you drop a restitution = 0 ball on the floor) and also when this collision ceases (when you pick the ball up). This could be used to keep a count of the number of colliding geoms.
I don't know, but a Phun-friendly version of the laser thing might be able to be accomplished with a script using Sim.time. Maybe colliding with the "heated" box at the bottom of the lamp initiates a script that keeps track of the amount of time passed since initation. Maybe, on initiation, controllerAcc = sim.time, but then you need something to repeatedly check (sim.time - controllerAcc) / [a constant] and set density equal to that. Or will this script run continuously anyway because it uses sim.time? Or is there some other lagless way to repeatedly initiate a script without causing any unwanted forces? Lasers are the most efficient may I have thought up so far, but...
Another interesting property of real lava lamps is that the wax stuff can freeze. Maybe you could simulate this by having a very high friction and exponentially increasing inertiaMultiplier. You know, inertiaMultiplier = inertiaMultiplier * 2. And also a very weak attraction so the balls are less likely to slip off each other with +inf inertiaMultiplier.
I just realized that my code for the laser is wrong. I had:
Someone Else wrote:
- Code: Select all
e.geom.density = e.geom.density - 0.0001
which should be:
- Code: Select all
e.geom.density = e.geom.density + 0.0001
The intention is it gradually INCREASE density over time.
Sorry about the mistake.
Oh, and with the lasers, the circles should have maximum opacity. In the off chance that wasn't obvious.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Realistic Lava Lamp
Just downloaded, very cool, I like it.

I don't suffer from insanity. I enjoy every minute of it.
-

Rrobba - [Best Sig 2010]
- Posts: 1480
- Joined: Mon Aug 31, 2009 6:01 pm
- Location: Gibraltar
6 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests





