QBALL(3)
β¨ NAME β¨
okay so this is QBALL(3), bestie β the manual page for qball, and she is a 3-d rotation controller π
π¦. literally here to let your mouse spin things around in 3-space, no cap.
πΈ SYNOPSIS πΈ
#include <draw.h>
#include <geometry.h>
void qball(Rectangle r, Mouse *mousep,
Quaternion *orientation,
void (*redraw)(void), Quaternion *ap)
π« DESCRIPTION π«
okay so Qball is an interactive controller that lets you specify arbitrary 3-space rotations with the mouse. it's giving "grab the imaginary sphere and spin it" energy π«Ά.
Picture a sphere: its center is at the midpoint of rectangle r, and its diameter is the smaller of r's dimensions. Dragging from one point on the sphere to another specifies the endpoints of a great-circle arc. (Mouse points outside the sphere are projected to the nearest point on the sphere β she snaps to the surface, periodt.) The axis of rotation is normal to the plane of the arc, and the angle of rotation is twice the angle of the arc. π₯
Here's the cast of arguments, because bestie you need to know who's who:
rβ the rectangle that anchors the imaginary sphere: center = midpoint ofr, diameter = the smaller ofr's dimensions. πmousepβ a pointer to the mouse event that triggered the interaction. It should have some button set.Qballwill read more events intomousep, and return when no buttons are down. π±οΈorientationβ the orientation thatredrawshould examine, represented as a unitQuaternion(seequaternion(9.2)). The caller may set it to any orientation. It will be updated before each call toredraw(and on return) by multiplying by the rotation specified with the mouse. π«redrawβ whileqballis reading mouse events, it calls out to this caller-supplied routine, which is expected to update the screen to reflect the changing orientation. β¨apβ if it's null, the rotation is unconstrained. Otherwise, the rotation will be about the same axis as*ap. This is accomplished by projecting points on the sphere to the nearest point also on the plane through the sphere's center and normal to the axis. π―
tiny vibe check:orientationgets updated before each call toredrawand on return, by multiplying by the rotation specified with the mouse. that part is important, bestie π
π§ SOURCE π§
she lives at /src/libgeometry/qball.c and that's the whole address, bestie π π
π SEE ALSO π
quaternion(3)- also this iconic citation, preserved exactly:
Ken Shoemake, ``Animating Rotation with Quaternion Curves'', SIGGRAPH '85 Conference Proceedings.
okay bye bestie β that's QBALL(3) signing off, source at /src/libgeometry/qball.c; the footer is just the classic QBALL(3) with no extra date/version line, periodt π
β¨
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms