Hello,

I’m taking a wild stab in the dark, here (well, any excuse to procrastinate, I feel <mutters about work he should be doing, but isn’t doing right at the minute>=) but it SOUNDS like the original poster is trying to figure out what rotations/transformations s/he wants to get the ball to rotate along an arbitrary vector.

Righty. The things you need to know are:

- the two end points of the trajectory,
- some other point on the ground plane, and
- the size of the sphere

from (1) you can compute how far you want the ball to roll, and along which vector. You also use the direction vector and (2) to figure out the plane its rolling on, and thus compute a vector along this plane that’s orthogonal to the vector in (1). (3) will tell you how far the ball travels in one rotation (ie. the length of its circumfrence).

<thinks deep mathematical thoughts for a moment or two> If the ball is at angle *q* at time 0 at the start vertex, *a*, then for an arbitary point p along the vector from *ab*, then the ball would have rotated

|p-a|

------ * 2.0*pi radians about its axis since it started … (1)

c

where |p-a| is the segment length from the start to the ball’s position, and c is the circumfrence of the sphere. So, all you need to do is position the ball at p, and rotate it by eqn (1) about the vector found using the ground plane point and the vector (points 1 and 2 above)

nice, eh? I thought so. <basks in round of applause for several moments> thank you, thankyou.

er, you find p by interpolating along the line. easy to figure out. but not now; some sultry female just rang me up right now telling me that my order is ready, so i’m off! Mwhahahah.

cheers

John