Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Alias software > Re: mel script ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 880 of 912
Post > Topic >>

Re: mel script with diamond checker board question tia sal2

by DTrel <DTrel@[EMAIL PROTECTED] > Oct 2, 2007 at 08:25 AM

On Tue, 02 Oct 2007 04:56:57 GMT, temp <temp@[EMAIL PROTECTED]
> wrote:
Hey sal2...

I seem to recall a Canadian TV commercial about diagonal shredded wheat...
You could simply place the required cubes in a square pattern, group them
together and then rotation the entire group 45 degrees.

However diagonal construction has its uses.When you work with 3D
constructions
the square root of 3 is often used to center objects with a face to face
unity.
Four octahedrons can be aligned to a tetrahedrons faces using the square
root of
3.

For your mel script, you could do this in many ways...
But you seem to be looking for an outer shell limit and then filling the
shell,
so...
//==============================================================
proc drawCube (float $x1,float $z1){
       polyCube;
       move -r $x1 0 $z1; //diamond
       rotate -r -os 0 -45 0;
       };
//====================
proc diagonalCubes(){
float $x, $z, $len, $max, $diag;
$len  =     sind(45.0);
$diag = 2 * sind(45.0);
$max  = 4;
//Draw the outer shell
for ($x = 0; $x < $max; $x++ ){
       for ($z = 0; $z < $max; $z++ ){
               drawCube($x*$diag, $z*$diag);
               }
       }
//Draw the inner shell: max = N-1, and offset = .707
$max--;	        // draw 1 less row and column
for ($x = 0; $x < ($max); $x++ ){
       for ($z = 0; $z < ($max); $z++ ){
               drawCube( ($x*$diag+$len), ($z*$diag+$len));
               // with an offset added of: .707 0 .707
               }
       }
};

diagonalCubes();

//==============================================================

hth's aen



>Greetings all 
>
>I have a mel script that works at making diamond shapes across and
down..I would like it to also have a diamond shape 
>where the gaps are located in between ...I think I need another for loop
but I'm not sure if I need another variable.
>
>int $i;
>int $j;
>for ($i =0; $i <4; $i++) {
>   for ($j=0; $j<4; $j++) {
>
>		polyCube;
>		move -r ($j*1.414) 0 ($i*1.414); //diamond
>		rotate -r -os 0 -45 0;
>		
>/* The diagonal of a square with a base of 1 is 1.414
> or square root of 2, or a 45 degree angle */

>	}
>}
>tia sal2
 




 2 Posts in Topic:
mel script with diamond checker board question tia sal2
temp <temp@[EMAIL PROT  2007-10-02 04:56:57 
Re: mel script with diamond checker board question tia sal2
DTrel <DTrel@[EMAIL PR  2007-10-02 08:25:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Nov 23 2:01:20 CST 2008.