Just started using the formula deformer. The default function is useful but of course just the tip of the iceberg. While I’m not completely mathematically illiterate, coming up with useful new formulas except by trial and error is beyond my abilities. I wondered if anyone had any nice formulas they’d like to share, or a link to some mathematics resource site with some likely candidates ?

Cheers for any suggestions.

# Request : some useful formulas for the formula deformer.

**Decade**#1

**fluffouille**#2

It’s in french, but the images should be self-explanatory: http://www.frenchcinema4d.fr/forum/index.php?topic=6896.0

**51M0N**#5

Wow, that’s a great resource, it’s like a formula wiki, thanks Sébastien. This may be a newbie question, but I tried replicating them with the formula deformer and it seems the deformer base80 uses is a bit different ( an older plugin perhaps?), and I don’t get any visible results.

Any ideas of how they should be translated into the formula deformer?

**Per-Anders**#7

Some of the most useful are the most basic

In r11.5 (with the new formula parser)

max(1-u;0)

this is just a linear falloff from the center of a radial effect

pow(max(1-u;o);2)

this is a falloff that’s curved in a nice quadratic shape. You can adjust the shape by changing the last number (the power) in the pow function from close to 0 to up to any value. 1 is linear, below curves out above curves in.

sin((u + t) * pi2)

a nice sine curve from the center moving over time (t), to apply a falloff just multiply it by one of the previous two, anythign you multiply it by will be it’s overall scale.

sin((u + t) * pi2 * 10)

the same thing but with 10 times the frequency of waves

finally a fun one to mess around with, set your formula deformer to manual mode then the formula to the following (and put a plane under it)

for x : sin(x*pi2) sin(zpi2)
for y : cos(x*pi2)

for z : sin(x*pi2)

*cos(z*pi2)

Then start messing a round with the size of the formula deformer. It’s also good fun to play with the values you multiply with to create more crazy shapes.

**fluffouille**#9

All these samples were produced with the Spline formula (it’s an old thread), so I’m not sure how much can be applied to the formula deformer.

**tcastudios**#10

Per-Anders, thanks for the jump start on the newer Formula Object!

Very nice to play with falloffs this way.

Since the formula field is a string, I feed some settings from

UserData (on the DropFormula Object) with a few tostring() values.

Cheers

Lennart

**Continuumx**#12

Thanks Lennart - Can you explain what you did with the coffee portion of this scene on the Drop Formula Objects?

**tcastudios**#13

It’s a way to use the Userdata to animate/edit the Formula field.

For example, if I want to animate the t-parameter in this:

sin((u + t) * pi2)

I add a Userdata to the object. That becomes op#ID_USERDATA:1.

In the coffee tag I write:

```
main(doc,op)
{
var t = op#ID_USERDATA:1;
var formula = "sin((u + " + tostring(t)+" * pi2)"; // Insert the value in the string
op#FORMULAOBJECT_DLT = formula; // Fill the formula field
}
```

Cheers

Lennart

**robotbob**#16

per added this to an interesting gerstner thread a while back

http://forums.cgsociety.org/showthread.php?f=47&t=673737&page=2&pp=15&highlight=gerstner

however Per do you have any idea why this file seems to be broken in 11.5 as it works fine in 11 ?

p

**JoelDubin**#17

Nice example there Lennart. I havent had a chance to look at the 11.5 features or d-load the demo. Do ALL deformers have falloff now? (sounds like at least the formula deformer does now?) That would be very nice.

**Mapache**#18

Some nice formulas can be found on this german page:

http://www.3d-meier.de/

Chao

Mapache

**Per-Anders**#19

The formula field is a bit more strict now, in that file the second formula doens’t have enough closing braces, just change the coffee to :

```
main(doc,op)
{
var freq = op#ID_USERDATA:1;
var wavelength = 1.0/op#ID_USERDATA:4;
var magnitude = op#ID_USERDATA:2;
var amplitude = op#ID_USERDATA:3;
var wavevector = 2 * pi * wavelength;
var x = "x - (" + tostring((wavevector / magnitude) * amplitude) + " * sin(" + tostring(wavevector) + " * x - " + tostring(freq) + " * t ))";
var y = "y + (" + tostring(amplitude) + " * cos( "+tostring(wavevector)+" * x - " + tostring(freq) + " * t )[B])[/B]";
op#FORMULAOBJECT_FX = x;
op#FORMULAOBJECT_FY = y;
}
```