Use the prescribed-speed time parametrization of a curve. On a regular part traversed in increasing , let and assume the prescribed speed is positive. The chain rule for velocity gives
Integrate this scalar ordinary differential equation with an adaptive Runge-Kutta method, arranging output at the exact times . Evaluate . Internal integration steps may be shorter than ; output interpolation must meet the same error tolerance, so variable numerical steps do not create variable frame times.
An equivalent implementation precomputes
by adaptive numerical integration. This function is strictly increasing. Bracket each in the table and invert using safeguarded Newton method or interval bisection; monotonicity makes each solution unique. Stop at , with a shorter final time interval if the total travel time is not a multiple of . This accounts for changes in both the curve's parameter speed and the physical speed, unlike equal increments in .
If the specified speed vanishes, examine the reciprocal-speed integral at that event. It may diverge, giving asymptotic approach, or be integrable, giving arrival in finite time. A scalar speed does not determine whether motion reverses or how it resumes after stopping; such behavior needs the physical dynamics or a chosen continuation. The positive-speed formula applies between these events, with the direction changed if the traversal reverses.
Use the equal-time points to estimate velocity and acceleration with centered finite differences:
At the endpoints use one-sided formulas of the desired order. A differentiated path and its time parametrization can instead supply these quantities. Let denote the gravitational acceleration, directed downwards. In the accelerating camera, the effective downward vector is , so the locally felt upward vector is . For a stationary camera this gives , fixing the sign.
The apparent-gravity camera frame is obtained by orthogonal projection and a cross product:
When , are perpendicular unit vectors, and completes a right-handed orthonormal basis: . Also , so the felt-up vector lies in the plane, with its transverse component pointing towards positive .
The stated exclusion of ensures , but it does not ensure . If felt-up is parallel to travel, the roll angle is undetermined rather than the construction being impossible. Every transverse orthonormal basis then has the required plane property. For continuity, project the previous into and normalize it, using . If this projection is also too small, choose a coordinate unit vector least aligned with and project that vector instead. Switch to this transported choice near the parallel case to avoid numerical amplification. A stopped vehicle likewise needs a chosen limiting travel tangent vector, since its zero velocity itself has no direction. None of this requires a Frenet frame, which can fail where curvature vanishes.

Articles by others on the same topic (0)

There are currently no matching articles.