Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] The Gaussian Function - Cloth + Water Physics

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jul 2008 23:36 Edited at: 31st Jul 2008 19:38
Hey guys, I made this function called "gaussian function", named after the great mathematician "Gauss". For more info about his biography, google his name.

It will work in DBC, and there is no reason it shouldn`t work in DBP.

Anyway, here is a screeny:



And here is the function:



How to use:



And 1 more thing:Have fun!!

Please report any errors and please reply!

TheComet

Suicide is away of telling God, You can’t fire me I quit !!!!!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jul 2008 00:25
Friggin' amazing, I was just trying to make this sort of thing (my previous approaches have used pre-made brush images).
Thanks man; perfect timing

"I kören hörs de brummande busarna Björnligan och Gondolen"
calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 15th Sep 2008 10:13
Here's a faster way: (using EXP(x) instead of e^x)



The optomist's right, The pessimist's right.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Sep 2008 00:49
In both versions, there will be inaccuracies unless you work with floats - the integer divisions inside the function particularly should be avoided.


Try this:



and this:



[Not tested by the way. ]
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Sep 2008 05:46
EXP() is useless in DBC. It only takes and returns integers. The attempt is to use the value (e^1)^value and EXP(value) will not return the same in DBC.



the return values from code
e#^value# = 1248.87
EXP(value#) = 1096

Enjoy your day.

Login to post a reply

Server time is: 2024-04-24 06:53:02
Your offset time is: 2024-04-24 06:53:02