Jump to content

Recommended Posts

13 hours ago, Librarian said:

@dyei nightmare 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@CohesionRadius = chf("CohesionRadius");
f@CohesionSpeed = chf("CohesionSpeed");

f@AlignmentRadius = chf("AlignmentRadius");
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
float SeparationRadius = @CohesionRadius * chf("speed");
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);
        }
}

DirectionToNeighbour *= 1.0 / SeparationRadius;

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)

 

odforce401400002544.gif

coooooooooooooooooooooooooooooooooooooooooooool!!!!!!!!! :wub::wub::wub::wub::wub::wub::wub::wub::wub::wub::wub:

Share this post


Link to post
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 :wub:with Better PC.

SEDRt0000.jpg

1452288.jpg

Share this post


Link to post
Share on other sites

Are you already starting to design your own coffn? :)

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

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

BlackChrome1.jpg.189ac53e34ae7cd8eb057779f305b77f.jpg

  • Haha 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×