3 qball \- 3-d rotation controller
13 void qball(Rectangle r, Mouse *mousep,
16 Quaternion *orientation,
19 void (*redraw)(void), Quaternion *ap)
22 is an interactive controller that allows arbitrary 3-space rotations to be specified with
23 the mouse. Imagine a sphere with its center at the midpoint of rectangle
25 and diameter the smaller of
27 dimensions. Dragging from one point on the sphere to another specifies the endpoints of a
28 great-circle arc. (Mouse points outside the sphere are projected to the nearest point
29 on the sphere.) The axis of rotation is normal to the plane of the arc, and the
30 angle of rotation is twice the angle of the arc.
34 is a pointer to the mouse event that triggered the interaction. It should
37 will read more events into
39 and return when no buttons are down.
43 is reading mouse events, it calls out to the caller-supplied routine
45 which is expected to update the screen to reflect the changing orientation.
48 is the orientation that
50 should examine, represented as a unit Quaternion (see
52 The caller may set it to any orientation.
53 It will be updated before each call to
55 (and on return) by multiplying by the rotation specified with the mouse.
57 It is possible to restrict
59 attention to rotations about a particular axis.
62 is null, the rotation is unconstrained.
63 Otherwise, the rotation will be about the same axis as
65 This is accomplished by projecting points on the sphere to
66 the nearest point also on the plane through the sphere's center
67 and normal to the axis.
69 .B \*9/src/libgeometry/qball.c
74 ``Animating Rotation with Quaternion Curves'',
76 SIGGRAPH '85 Conference Proceedings.