PDA

View Full Version : clamp


arunspooja
05-17-2006, 07:46 AM
Good Afternoon



I have rotated an object using clamp.



First of all i'll tell what i need. create a cylinder and make its pivot move towards the bottom end of the cylinder.



Then rotate the cylinder x-axis 90 degree and freeze transformation.



Now create a circle and rename the circle->main and the cylinder->tube1



then i have written the below expression





int $on_Off=main.on_Off;

float $tube1_rotX=tube1.rotateX;

float $tube1_rotY=tube1.rotateY;

tube1.rotateX=clamp(-16,1,(sin(time*2)*15*$on_Off));

tube1.rotateY=cos(time*2)*-15*$on_Off;

//tube1.rotateX=(tube1.rotateX+($offsetZ-$tube1_rotZ));

//tube1.rotateY=(tube1.rotateY+($offsetY-$tube1_rotY));

if($on_Off!=1)

{

tube1.rotateX=$tube1_rotX;

tube1.rotateY=$tube1_rotY;

}





now i want to control its speed in the middle ie, when the cylinder raises above in x and y axis



the x axis speed should be slow inbetween -9 to -20 to -9



and the corresponding y axis value should also be slow.



If any body find the solution, kindly reply.



Thankyou

CGTalk Moderation
05-17-2006, 07:46 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.