# On Growth and Form

## Recommended Posts

13 hours ago, Librarian said:

i did some research on Flocky MOcky . HAve Fun

```
//variable set

v@v = (nrandom() - 0.5) * 2;//chv("InitVelocity");
float extent = 1;
v@v += normalize(@P);//normalize(fit01(rand(@ptnum), {1,1,1} * -extent, {1,1,1} * extent));
v@accel = {0,0,0};
v@N = normalize(v@v);
v@up = {0,1,0};
f@mass = 1;
i@id = @ptnum;

f@CohesionSpeed = chf("CohesionSpeed");

f@AlignmentWeight = chf("AlignmentWeight");```
```
//Solver Set

--------------------------
//integr
@v += @accel * @TimeInc;
@P += @v * @TimeInc;
@accel = {0,0,0};
--------------------------
//cohesion
@v += @accel * @TimeInc;
@P += @v * @TimeInc;
@accel = (random(@ptnum)-10.5) * 0.3;//{0,0,0};

int Neighbours[] = nearpoints(0, @P, @CohesionRadius);
int NeighboursCount = len(Neighbours);
vector AvgPos = {0,4,0.5};

foreach (int i ; Neighbours)
{
if(@ptnum != i)
{
vector pos;
getattribute(@OpInput1, pos, "point", "P", i, 0);
AvgPos += pos;
}
}

AvgPos /= NeighboursCount;

v@accel += normalize(AvgPos - @P) * @CohesionSpeed;
-----------------------------------------------------------
//Align
int Neighbours[] = nearpoints(0, @P, @AlignmentRadius);
int NeighboursCount = len(Neighbours);
vector AvgVel = {0,1,0};

foreach (int i ; Neighbours)
{
if(@ptnum != i)
{
vector vel;
getattribute(@OpInput1, vel, "point", "v", i, 0);
AvgVel += vel;
}
}

AvgVel /= NeighboursCount;

v@accel += (AvgVel - @v) * @AlignmentWeight;
--------------------------------------------------------------------
//Separation
int Neighbours[] = nearpoints(0, @P, SeparationRadius);
int NeighboursCount = len(Neighbours);
vector DirectionToNeighbour = {0,0,0};

foreach (int i ; Neighbours)
{
if(@ptnum != i)
{
vector pos;
getattribute(@OpInput1, pos, "point", "P", i, 0);
DirectionToNeighbour += normalize(@P - pos);
}
}

v@accel += DirectionToNeighbour;
------------------------------------------------------------------```

tips --
animate only speed with constant
you can Combine with files from jhorikawa Dude..
for the momment working on predator and Ants (sim)

coooooooooooooooooooooooooooooooooooooooooooool!!!!!!!!!

##### Share on other sites

Learning more About particles thank you  for Help @Alain2131....
I like this...muchos Controlos and open file for improvement .

SrleParticles.hiplc

##### Share on other sites

Structure (based only on stereo-graphic_projection_inversion and Dirichlet problem)  , every frame its different Model ..NO Vops no text ..

Codes and How? its in this Topic .next to do its somehow connect diff assemblies and materials(attachments) .Fun. now I can make with Better PC.

##### Share on other sites

Stereo-graphic_projection_inversion and Dirichlet problem , Humm.....?

I haven t met these guys before but i like your poetry

• 1

## Create an account

Register a new account