How to make the Oil-leak effect

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

How to make the Oil-leak effect

Postby polar1225 » Tue Mar 27, 2012 8:19 am

Hi guys!i am working on a project about environmental protection.
I make the scene consist of seawater(addWaterSurfaceSceneNode()...) and a tanker.But how can i make the oil-leak effect like this. :(
Image
And oil can be pieces of erased。。My idea is to use particle system。。but i really don't believe that can be authentic! :oops:
polar1225
 
Posts: 7
Joined: Tue Feb 21, 2012 12:18 pm

Re: How to make the Oil-leak effect

Postby CuteAlien » Tue Mar 27, 2012 8:39 am

Depends on how realistic you want it to be. You can get pretty good results with repeatable patterns. So in the center you have only "black" blocks. On the borders you have border-blocks with a few types of curves. That would be rather static, but depending on the type of game it would be sufficient. If you want it all dynamic - more tricky I guess ...
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5359
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: How to make the Oil-leak effect

Postby polar1225 » Tue Mar 27, 2012 8:57 am

Emm..The problem is to realize the spread of liquid effect..I have no idea!
polar1225
 
Posts: 7
Joined: Tue Feb 21, 2012 12:18 pm

Re: How to make the Oil-leak effect

Postby CuteAlien » Tue Mar 27, 2012 9:49 am

Your advantage is that most likely neither will your users have an idea how oil spreads realistically, so you probably get away with anything. Realistic distribution sounds hard. Fluid physics involving ocean waves, I guess you could probably do a doctoral thesis on that. So I only can give hints how games fake similar situations. Without having really dug deeper into this - my first approach to this would probably be to have a 2d-array covering the max-size I allow (before you lost the game anyway for example). The array would contain the amount of oil on each quadrant. And then there would be an update function which ones in a while goes over the whole array and depending on amount of oil in neighbor cells + some random factor it would increase the oil-value in fields (similar to the game life). And then display would use repeating patterns which just have to make sure they always have contact-lines with the neighbor fields. Speed of spreading oil etc ... just modify it until it plays well (if it is a game).
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5359
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: How to make the Oil-leak effect

Postby ACE247 » Tue Mar 27, 2012 7:42 pm

A projected animated texture on the waves maybe? That would be simple and ideal, there's some source code for texture projection flying on the forum somewhere, search long enough and you'll find it, was part of a larger irrlicht glsl effects thing if im right.
H8L6L5M4G3H5M7N8S7N9O1R8J1P5M7N9O4P2Q5R6T7U4M3N8X6S5T8W (If you want the secret, why not 'TRY' decrypting it? )
This Door's lock doesn't need a key, the Lock is the key to open the Lock and you don't know how to turn the key...
Link: My Blog :)
User avatar
ACE247
 
Posts: 695
Joined: Tue Mar 16, 2010 12:31 am
Location: Namibia


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest