Skip navigation

Tag Archives: curves

With the use of 2 scripts,
1

for($j=1; $j<419; $j++){
$blob = “test8_blogram_” + $j;
select -r $blob;
string $poly[] = `ls -sl`;

if($poly[0] != “”)

{

string $verts[] = `polyInfo -fv $poly[0]`;
string $vert[] = stringToStringArray($verts[0],
“FACE :”);
string $obj[] = `ls -sl -objectsOnly`;

int $numVerts = (`size ($vert)`-2);

float $px=0;
float $py=0;
float $pz=0;

for ($i=1; $i< ($numVerts+1); $i++)
{
string $vertID = ($obj[0]+”.vtx["+$vert[$i]+”]”);
float $pos[] = `xform -q -ws -t $vertID`;
$px += $pos[0];
$py += $pos[1];
$pz += $pos[2];
}

vector $center = <<($px/$numVerts), ($py/$numVerts),
($pz/$numVerts)>>;

print (“center point of “+$poly[0]+ ” is: “+ $center);

int $curveExists = (`objExists (“curve_pt_” + $i)`);
if($curveExists == 0)
{
string $initialCurve = (`curve -p ($px/$numVerts) ($py/$numVerts) ($pz/$numVerts) -degree 1`);
rename $initialCurve (“curve_pt_” + $i);
}
if($curveExists == 1)
{
curve -a -p ($px/$numVerts) ($py/$numVerts) ($pz/$numVerts) (“curve_pt_” + $i);
}
};
}

2

for ($a=0; $a<418; $a++){
$blob = “test5_blogram_” + $a;
select -r $blob;
int $x= rand(-25,25);
int $y= rand(-2,4);
int $z= rand(-25,25);
int $k= rand(-25,-10);
int $l= rand(10,25);
int $j= rand($k,$l);
print (” — “+$j);
{
if ($x>-10 && $x<10)
move ($l/10) $y ($j/10);
else if ($x<=-10 || $x>=10)
move ($x/10) $y ($z/10);
}
}

the blograms are placed with a certain logic. The more we approach the football court, the bigger the density, of uses and connections, becomes, as shown in the pictures. The density and connectivity graduation is shown in the picture that has all the blograms in 2 arrays. On top is the openness (from little to more) and at the bottom is the connectivity (from big to small).

First we select our blograms.
Then according to the number of the blograms that we want to connect, we change the
number in the start of the following script(in our case we take into account all the
blograms). The script is going to calculate the centre of each one of our blograms and
it will create a curve point inside them. Then with another script we are going to
connect these centres and visualize the current connections between the blograms.

CALCULATION OF BLOGRAMS CENTRE:

for($j=1; $j<419; $j++){
$blob = "test6_blogram_" + $j;
select -r $blob;
string $poly[] = `ls -sl`;

if($poly[0] != "")

{

string $verts[] = `polyInfo -fv $poly[0]`;
string $vert[] = stringToStringArray($verts[0],
"FACE :");
string $obj[] = `ls -sl -objectsOnly`;

int $numVerts = (`size ($vert)`-2);

float $px=0;
float $py=0;
float $pz=0;

for ($i=1; $i< ($numVerts+1); $i++)
{
string $vertID = ($obj[0]+".vtx["+$vert[$i]+"]");
float $pos[] = `xform -q -ws -t $vertID`;
$px += $pos[0];
$py += $pos[1];
$pz += $pos[2];
}

vector $center = <>;

print (“center point of “+$poly[0]+ ” is: “+ $center);

xform -os -t ($center.x) ($center.y) ($center.z)
locator1;
string $initialCurve = (`curve -p ($px/$numVerts) ($py/$numVerts) ($pz/$numVerts)`) ;
};
}

CONNECTION OF CENTRES:

The script i used is in this site:

http://www.creativecrash.com/maya/downloads/scripts-plugins/modeling/curve-tools/c/fb-wire-jumbler

In the pictures above is a visualization of the procedure.

simply we affect the particles from curve 1 to our new 2 radial fields

now we have 2 particle shapes (from curve1 and from curve2) being affected by 3 radial fields
if we compare the new curves created with the initial ones (light green) we can see the tranforms
made by the radial fields

first we build our curves and then we make them goal for our particles

i decided to manage fewer lines than the previous examples, so we change the emmition
rate to 2 (current situation)

we make layers so as to categorize our stuff

in the goal offset expression in both the particleShapes i changed the numerical data to
for the particles to have more space to interact in the later steps.

next after some experiment with the particles attributes i changed(in the goal weights and

objects menu) the Goal Smoothness to 6.000 and the curve Shape to 0.400

after the source of the script we take the first curves before any fields apply to our

particles

next we insert a radial field and we change its magnitude to 3.5 (repeller) and its attenuation

to 1.7, we make its volume shape to sphere so as to view the a.o.e.

first we test the results in the particleShape1

then we make the particleShape2 to be affected by the field we have created

we can observe that when the particles insert the radial field their Y direction (height) tend to

go to value 0. and some of the particle are pushed away from the field’s source.

after that we insert a new radial field but this time it will be used as an attractor, so its

magnitude will have a negative value. In this case i gave it -5.000, a rather big value in

association with the previous field but that way we can visualize the results more easily, and

understand the forces applied to the particles.

Follow

Get every new post delivered to your Inbox.