Im using

```
node -> setRotation(vector3df)
```

which is global as far as im aware, though please correct me if im wrong (node->setPosition() is unafected by setRotation)

hares the code that calculating the rotations, basicly it divides up the circumference into angle steps, and works out how meany steps to rotate the ball on the x and z acsisses.

```
void movable_ball::move_ball(core::vector3df loc)
{
if(switchh == 0)
switchh = 1;
else
switchh = 0;
// set position
ball->setPosition(loc);
// calculate movement delta
core::vector3df mov_delta = loc - old_loc;
// calculate rotation for X accsis
if(switchh == 1)
{
for(int angle = -30; angle < 31; angle ++)
{
float dist_moved_min = angle_step * angle;
float dist_moved_max = angle_step * (angle +1);
if(mov_delta.X > dist_moved_min && mov_delta.X < dist_moved_max)
{
// fix speed bug when angle is negative
if(mov_delta.X < 0)
angle += 1;
// apply rotation
core::vector3df ball_rot = ball->getRotation();
ball->setRotation(core::vector3df(ball_rot.X,ball_rot.Y,ball_rot.Z -= angle));
break;
}
}
} // end X acsiss rotation
else
{
// calculate rotation for Y accsis
for(int angle = -30; angle < 31; angle ++)
{
float dist_moved_min = angle_step * angle;
float dist_moved_max = angle_step * (angle +1);
if(mov_delta.Z > dist_moved_min && mov_delta.Z < dist_moved_max)
{
// fix speed bug when angle is negative
if(mov_delta.Z < 0)
angle += 1;
// apply rotation
core::vector3df ball_rot = ball->getRotation();
ball->setRotation(core::vector3df(ball_rot.X += angle,ball_rot.Y,ball_rot.Z));
break;
}
}
// save old location
old_loc = loc;
}
}
```