Realistic Lava Lamp

Discuss scenes and videos made with Algodoo.

Realistic Lava Lamp

Postby gmowebster » Mon Dec 27, 2010 1:44 am

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. :D

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:

Rating: rated 5.6
Filesize: 20 kB
Comments: 0
Ratings: 2
download


Please Comment and Rate!
gmowebster
 
Posts: 3
Joined: Sat Sep 05, 2009 10:40 pm

Re: Realistic Lava Lamp

Postby kilebantick » Mon Dec 27, 2010 12:48 pm

I like it.
Image
User avatar
kilebantick
 
Posts: 1267
Joined: Tue Sep 01, 2009 9:50 am

Re: Realistic Lava Lamp

Postby Someone Else » Tue Dec 28, 2010 5:10 am

Yes, very cool. :thumbup:

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...
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.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Realistic Lava Lamp

Postby gmowebster » Sat Jan 01, 2011 4:32 am

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.
gmowebster
 
Posts: 3
Joined: Sat Sep 05, 2009 10:40 pm

Re: Realistic Lava Lamp

Postby Someone Else » Sun Jan 02, 2011 1:59 am

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:

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...
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.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Realistic Lava Lamp

Postby Rrobba » Sun Jan 09, 2011 10:46 pm

Just downloaded, very cool, I like it.
Image
I don't suffer from insanity. I enjoy every minute of it.
User avatar
Rrobba
[Best Sig 2010]
 
Posts: 1480
Joined: Mon Aug 31, 2009 6:01 pm
Location: Gibraltar


Return to Scenes

Who is online

Users browsing this forum: No registered users and 5 guests