Hi
Can some one out there can pls help me with this script of mine it is on the creation of stairs but right now it is giving me problem at the time of execution the problem is with the results which i am getting after the execution of the script.
i am posting you the script pls check it and tell me what is the problem.
with regards
sid's
following is the script for stairs creation:
global proc stairs(float $Angle , float $stairsLength , float $stairsHeight , float $stairsSteps , float $dis_base , float $dis_height)
{
// variables for steps,height,length,angle,etc.
float $stairsAngle = 45; // setting angle to default value of 45.
float $stairsHeight;//setting stairs height.
float $stairsLength;//setting stairs length.
float $stairsSteps;//setting stairs steps.
float $dis_base;//distance from the base.
float $dis_height;// distance from the height.
// creating a array variable for object to use as base of the stairs.
string $temp[];
// creating a second array variable for object to use as side of the stairs.
string $temps[];
//finding the angle of stairs according to the pythagoras theorem which is tan angle = opposite / adjacent
float $stairsAngle = atand ( $stairsHeight / $stairsLength);
//finding the length of stairs.
float $stairsLength = ( $stairsLength / $stairsSteps);
//finding the height of stairs.
float $stairsHeight = ( $stairsHeight / $stairsSteps);
//checking if stairs angle is more than or less than 45 degree.
if (($stairsAngle < 45) || ($stairsAngle > 45))
{
print("Stairs Angle is" + $stairsAngle + "\n");
}
$dis_base = ($stairsLength * $stairsSteps);
$dis_height = ($stairsHeight * $stairsSteps);
$temp = polyPlane -w ($stairsLength * 1.0) -h $stairsHeight -sx 1 -sy 1 -ax 0 1 0 -ch 0;
$temps = polyPlane -w ($stairsLength * 1.0) -h $stairsHeight -sx 1 -sy 1 -ax 0 1 0 -ch 0;
move -r ($stairsLength *0.5) ($stairsLength *-0.5) 0;
rotate 0 0 90;
int $i = 0;
for($i=0;$i<$stairsSteps;$i++)
{
$temp = `duplicate -rr`;
$temps = `duplicate -rr`;
move -r ($stairsLength * 0.5) ($stairsHeight * 0.1) 0;
$temp = $temps;
}
}
stairs(45,100,300,20,50,70);