Freezing water on collide

About advanced scenes, and the Thyme scripting language used in Algodoo.

Freezing water on collide

Postby rowanphilip » Thu Jun 16, 2011 8:00 pm

Is it possible (and how) to freeze water on collide with a solid? Please don't give negative replies. I am new to algodoo scripting and I cannot find this on the forums.
rowanphilip
 
Posts: 3
Joined: Thu Jun 16, 2011 7:55 pm

Re: Freezing water on collide

Postby daniels220 » Thu Jun 16, 2011 9:43 pm

It's possible to liquify a solid on contact with anything, but I don't think the reverse is possible, since a blob of water isn't a single object. I'm not sure collisions with water even trigger onCollide (on the other geom), and water particles certainly don't have an onCollide event of their own. There is an algorithm in Algodoo for whether a water particle is "in contact" with another, which could be used to find contiguous bodies of water, but there's no way to freeze them.
daniels220
 
Posts: 95
Joined: Mon Aug 31, 2009 11:30 pm

Re: Freezing water on collide

Postby rowanphilip » Thu Jun 16, 2011 10:10 pm

Ok, I know that you can freeze water manually, I was just wandering if it could be done when a certain target is met.
rowanphilip
 
Posts: 3
Joined: Thu Jun 16, 2011 7:55 pm

Re: Freezing water on collide

Postby TC42 » Thu Jun 16, 2011 11:13 pm

I mean, technically you can do it, it would just be insanely complicated. You would have to spawn geoms (polygons, probably) in the shape of the contacting water droplets, and fix them to existing geoms, then delete the water droplet that contacted them. It certainly can be done, it would just be really difficult. If you manage to pull it off, I will be extremely impressed. :thumbup:
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Freezing water on collide

Postby Dare » Fri Jun 17, 2011 1:12 pm

... or you could make polygon water, such as this, and make the density become +inf when it collides with something.

Code to freeze:
Code: Select all
(e)=>{e.this.density := +inf}


Code to unfreeze:
Code: Select all
(e)=>{e.this.density := 2.0}


Obviously you can change the density back to any value you want, but 2.0 is the default value.
ImageImage
TC42 wrote:Dare, you are creepy.

Official Algobox Admin! Please PM me if you have any issues regarding Algobox.
User avatar
Dare
 
Posts: 833
Joined: Sat Nov 21, 2009 4:27 pm
Location: Sydney, Australia

Re: Freezing water on collide

Postby rowanphilip » Sat Jun 18, 2011 7:38 pm

The problem is that it collides with itself and freezes when you don't want it to.
rowanphilip
 
Posts: 3
Joined: Thu Jun 16, 2011 7:55 pm

Re: Freezing water on collide

Postby Rideg » Sat Jul 02, 2011 3:04 pm

Density of water is 0.1kg/m^2.

Make several circles with controllerAcc = "unique number" example 1995.
Give freezer's controllerAcc an = "unique number" example 1337.

OnCollide:
Code: Select all
(e)=>{
    e.other.controllerAcc != 1995 ? {
        e.other.controllerAcc == 1337 ? {
            e.this.density = +inf;
            e.this.controllerAcc = 1337;
            e.this.color = [0.8, 0.8, 1.0, 1.0]
        } : {}
    } : {}
}


Try.
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests