Wednesday, March 16, 2011

scripting exercise - first attempts


//------------------------XXL------------------------
//Γαρύφαλλος Παπαδόπουλος__Νίκος Χριστοδούλου__Νεφέλη Χαρχαρή
//March 2011.
//http://xxl-auth.blogspot.com/

//give a value to "k" !!
int $k=10;
for ($j=0; $j<$k; $j++)
 {
   for ($i=0; $i<19; $i++)
   {
   
    //create a string for the name
    string $myName;
    $myName = "object" +$i +"_" +$j;
    //create a polyCube and give it the name
    polyCube -n $myName;
    //move it
    move 0 (2*$i) (20*$j) $myName;
    //scale it
    scale ($i  +1) 1 1 $myName;
    //rotate it
    rotate 0 (5*$i) 0 $myName;
      
    //rename  
    $myName = "object"+$i +"_" +$j +"_b";
    //create a polyCube and give it the name
    polyCube -w (19 - $i) -n $myName;
    //move it  
    move 0 (2*$i) (10 + (20*$j)) $myName;
    //rotate it
    rotate 0 (90 + 5*$i) 0 $myName;
    }
 } 
/span>

//------------------------XXL------------------------
//Γαρύφαλλος Παπαδόπουλος__Νίκος Χριστοδούλου__Νεφέλη Χαρχαρή
//March 2011.
//http://xxl-auth.blogspot.com/

int $a=0;    
for ($i=2 ; $i<17; $i++)
{    
    //create a string for the name
    string $myName;
    $myName = "object" + ($i -2);
    
    if ($i%2 ==0)
    {
    float $k = $i - 1;
    polyPyramid -n $myName;
    //move it
    move 0 $a 0 $myName;
    //$a= ($a+($k/2)+2);
    //scale it
    scale $k ($k/2) $k $myName;
    //rotate it
    rotate 0 (5*$k) 0 $myName;
    }
    
    else
    { 
    float $k = $i; 
    polyPyramid -n $myName; 
    //move it
    move 0 $a 0 $myName;
    //$a= ($a+($k/2)+2);
    //scale it
    scale $k ($k/2) $k $myName;
    //rotate it
    rotate 180 (5*$k) 0 $myName;    
    }   
    $a=(($k/2)*($i - 1)) ;
}


//------------------------XXL------------------------
//..................
//March 2011.
//http://xxl-auth.blogspot.com/

for ($i=0; $i<10; $i++)
  {  
   for ($j=0; $j<10; $j++)
      {  
       for ($k=0; $k<10; $k++)
       {
       
        string $myName;
        $myName = "object" + $i + $j + $k ;
        if ($k%2 == 0) {
               polyCube -n $myName;
        }
        else {
        polySphere -n $myName;
        }
        if ($j%2 == 0) {
               polyCube -n $myName;
        }
        else {
        polySphere -n $myName;
        }
        
        if ($i%2 == 0) {
               polyCube -n $myName;
        }
        else {
        polySphere -n $myName;
        }
               
        move (4*$i) (4*$j) (4*$k) $myName;
        rotate (2*$i) (2*$j) (2*$k) $myName;
      // mporeis na baleis k scale $i 1 1 $myName; an theleis  
    }
  }
} ; 
/span>

 

//------------------------XXL------------------------
//Ελεάννα Μπρέζα / Μυρτώ Σκρέτα-Κρίκου
//March 2011.
//http://xxl-auth.blogspot.com/

for ($i = -40; $i<40; $i++) {
string $name;
if ($i<0){
$name = "object" + (40-$i);
}
else if ($i>=0){
$name = "object" + $i;
}
if ($i%2==0){
polyCube -n $name;
}
else if ($i%2==-1){
polySphere -n $name;
}
else if ($i%2==0){
polyCube -n $name;
}
else if ($i%2==1){
polySphere -n $name;
}
move 0 (2*$i) 0 $name;
scale $i 1 1 $name;
if ($i<0){
rotate 0 ($i*5) 0 $name;
}
else if ($i>=0){
rotate 0 ((-$i)*5) 0 $name;
}
};


//------------------------XXL------------------------
//Ελεάννα Μπρέζα / Μυρτώ Σκρέτα-Κρίκου
//March 2011.
//http://xxl-auth.blogspot.com/

for ($i = -40; $i<40; $i++) {
string $name;
if ($i<0){
$name = "myCube" + (40-$i);
}
else if ($i>=0){
$name = "myCube" + $i;
}
polyCube -n $name; 
move 0 (2*$i) 0 $name;
scale $i 1 1 $name;
if ($i<0){
rotate 0 ($i*5) 0 $name;
}
else if ($i>=0){
rotate 0 ((-$i)*5) 0 $name;
}
};

No comments:

Post a Comment