Similar to a previous exercise, I am arranging cubes in a letter W. Again, if you're having trouble visualizing the end result, then think of every cube as a pixel, building a sprite of 'W'.
I created 4 sections of my code, 1 for each stroke making up the letter, but 2 of each have the same 'root point':
file -f -new;
//Specifies starting coordinates
int $xpnt1 = 5.5;
int $xpnt2 = -5.5;
//////////////////
for($i=1;$i<=25;$i++) { //BRANCH 1, POINT 1, DIR L
polyCube;
move -ws $xpnt1 0 0;
//select "pCube1";
move -r ($i*1) ($i*1) 0;
move -r $xpnt1 0 0 pCube1.scalePivot;
}
for($i=1;$i<=25;$i++) {//BRANCH 2, POINT 1, DIR R
polyCube;
move -ws $xpnt1 0 0;
//select "pCube26";
move -r ($i*-1) ($i*1) 0;
move -r $xpnt1 0 0 pCube26.scalePivot;
}
for($i=1;$i<=25;$i++) {//BRANCH 3, POINT 2, DIR L
polyCube;
move -ws $xpnt2 0 0;
//select "pCube51";
move -r ($i*1) ($i*1) 0;
move -r $xpnt2 0 0 pCube51.scalePivot;
}
for($i=1;$i<=25;$i++) { //BRANCH 4, POINT 2, DIR R
polyCube;
move -ws $xpnt2 0 0;
//select "pCube76";
move -r ($i*-1) ($i*1) 0;
move -r $xpnt2 0 0 pCube76.scalePivot;
}
So far, I've been able to get the cubes to spawn how I'd like. The main problem here is one that came up erroneously: despite having 2 of each share either 5.5 or -5.5 as starting coordinates, they end up being spaced apart by what appears to be the program: this is the current result. What ever could I be missing or ignoring that's causing this problem?
KEEP IN MIND THAT I'M AWARE 5.5/-5.5 WILL NOT PRODUCE A CORRECT W. I'M USING THESE COORDS TO TEST SPAWNING BASE CUBES TO OCCUPY THE SAME SPACE.