Kód: Vybrať všetko
def RotateObject(object,dx,dy,dz,rotation_time=1,speed=1)
dirx = 1.0;
diry = 1.0;
dirz = 1.0;
if(dx<0.0) then dirx = -1.0 end
if(dy<0.0) then diry = -1.0 end
if(dz<0.0) then dirz = -1.0 end
a=dx/(rotation_time);
deltax = speed * dirx * $FRAMETIME;
deltay = speed * diry * $FRAMETIME;
deltaz = speed * dirz * $FRAMETIME;
## Rotation angle
$angle = $angle + ($FRAMETIME/16.0)*360.0;
## Are we about to change model?
if($angle > $max_rotation) then
$angle = 0;
$modelID = $modelID + 1;
end
## Looping
if($modelID > 5) then
$modelID = 0;
end
## Now we set rotation to each model
$gallon_small_finished.oz = $angle;
end
//autoeditácia príspevku ( 06 Apr 2009, 19:16 )
už som to vyriešil môžte lock