Formulas
Introduction
Section titled “Introduction”Here is a page with Cinema 4D Formulas that you can use for Formula Effectors or Fields. Formulas are primarily based on C++ syntax.
Formula Appendix, Maxon Help Guide
Section titled “Formula Appendix, Maxon Help Guide”Basic
px,py,pz - Positionrx,ry,rz - Rotationsx,sy,sz - Scale
u,v,w - UVWid - Object Indexcount - Object Count
falloff - Falloff weightt - Project Time[-∞..+∞]f - Frequency[-∞..+∞]
Conditional?(a;b)(3>4)?(10;20)?(a;b)
Arguments such as mod(a;b) must be separated by a semi-colon or by squared brackets [] (then without curved brackets)
rnd(100) is the same as rnd[100] and rnd(100;234) is the same as rnd([100][234]).Mathematical Operators
+ Addition 144 + 14 = 158- Subtraction 144 - 14 = 130* Multiplication 144 * 2 = 288/ Division 144 / 12 = 12( Left parenthesis 3 + 4 * 2 = 11Units
km Kilometer 1km = 1000mm Meter 144 - 14 = 130cm Centimeter 1cm = 0.01mmm Millimeter 1mm = 0.001mum Micrometer 1um = 0.000001mnm Nanometer 1nm = 0.000000001mmi Mile 1mi = 1609.344 myd Yard 1yd = 0.914mft Foot 1ft = 0.305min Inch 1in = 0.025mB Frame NumberLogical Operators
= Equal compare 1km = 1000m== Equal compare 144 - 14 = 130> Greater than 1cm = 0.01m< Less than 1mm = 0.001m>= Greater than or equal compare 1um = 0.000001m<= Less than or equal compare 1nm = 0.000000001m!= Not equal compare 1mi = 1609.344 m! Not 1yd = 0.914m|| or. or Or 1ft = 0.305m&& or. and And 1in = 0.025m& Bitwise and| Bitwise or^ Bitwise xor~ Bitwise not?(a; b) Condition, if statement: a, then b (3 > 4) ? (10; 20) = 20; kann ebenfallsso formuliert werden: if(3 > 4; 10; 20)Constants
e The constant e (Euler Number) = 2.71828pi The constant Pi (circular number) = 3.14159pi05 Half Pipi2 Double Pipiinv Inverse Pipi05inv Half inverse Pipi2inv Double inverse Pi
// Functionssin(a) Sinuscos(a) Cosinusacos(a) Arcus cosinusasin(a) Arcus Sinustan(a) Tangentatan(a) Arcus tangentcosh(a) Cosinus hyerbolicussinh(a) Sinus hyerbolicustanh(a) Tangent hyerbolicusfloor(a) Round down floor(11.8) = 11ceil(a) Round up ceil(11.2) = 12round(a) Rund round(11.8) = 12abs(a) Absolute / Value abs(-11) = 11sqr(a) Square exponentiation sqr(5) = 25sqrt(a) Square root sqrt(49) = 7exp(a) Exponential function exp(5) = 148.41log10(a) Logarithm to the base of10 log10(100) = 2log(a) Logarithm to the base of e log(e) = 1trunc(a) Truncates a number trunc(-11.8987) = -11rnd(a{; b}) Random or 0 and a, opt. b as seedpow(a; b) Exponentiation pow(2; 3) = 8mod(a; b) Modulo mod(10; 4) = 2clamp(a; b; c) Clamps val. of c or a & b clamp(2; 6; 10) = 6min(a; b) Minimum value a or b min(4; 7) = 4max(a; b) Maximum value a or b max(4; 7) = 7(a) << (b) Bitwise shift to left 1 << 4 = 16(a) shlGetting Started
Section titled “Getting Started”Concepts
Section titled “Concepts”White to dark vertical
id/countDark to white center, vertical
1 - abs(mod(id/count; 1) - 0.5)*2Dark to white center, horizontal
1 - abs(mod(u; 1) - 0.5)*2Radial - White to Dark Center
sqrt(px*px + py*py + pz*pz)/1000Formula Library
Section titled “Formula Library”Default/Wave
/0.5 + sin( ( subfields + ( id / count ) + d ) * f * 360 ) * 0.5Alternating Lines

mod((id/80);2)?(t*f;-t*f)