Frei Otto Asset – design tip – Tutorial

Frei Otto Asset – design tip – Tutorial

People asked me how to do the patterns from the FreiOttoAttractor Asset Walktrough Video
Here is a short tutorial for this!


Code For First Wrangle Node (Circle Generator)


//user controls
int sample = chi(‘sample’);
float radius = ch(‘radius’);
vector center = chv(‘center’);
float TWO_PI = 3.14*2;
//circle formula
float theta = 0;
float step = TWO_PI / (float)sample;
float x,z;
vector pos;
while(theta < TWO_PI)
x = center.x + cos(theta)*radius;
z = center.z + sin(theta)*radius;

pos = set(x, center.y, z);

addpoint(0, pos);

theta += step;

Code for Second Wrangle (Lines Generator)


//user controls
int line = addprim(0, ‘polyline’);
int const_offset = chi(‘offset’);
float phase = ch(‘phase’);

float Pi = 3.14;

//additional offset
float fit_ptnum = fit(@ptnum, 0, npoints(0), 0, Pi*phase);
int sin_offset = (int)(sin(fit_ptnum) * ch(‘sin_offset’));

//find connection neighbour
int neigh = (@ptnum + const_offset + sin_offset)%npoints(0);

//create the connection line
addvertex(0, line, @ptnum);
addvertex(0, line, neigh);

Code is designed by Anastasia Opara and is explained in detail in this video

Frei Otto Attractor asset is here :

Thank youy and enjoy this tip