The Hamilton filter uses quaternion mathematics to provide smooth, natural rotations without gimbal lock artifacts. It applies Slerp (Spherical Linear Interpolation) for rotations and Lerp (Linear Interpolation) for translations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/opentrack/opentrack/llms.txt
Use this file to discover all available pages before exploring further.
This filter is ideal for users who want smooth, cinematic head movements and don’t mind some lag in exchange for artifact-free rotation paths.
How It Works
The Hamilton filter treats rotations and translations separately:- Rotations: Converted to quaternions, smoothed using Slerp interpolation
- Translations: Smoothed using standard linear interpolation
Quaternion Advantage
Unlike Euler angle filters, quaternion interpolation:- ✅ No gimbal lock at 90° pitch
- ✅ Smooth rotation along the shortest path
- ✅ No axis order dependency
- ✅ Natural feel for large rotations
Algorithm
The filter uses distance-based alpha calculation with power curves:Rotation Smoothing
Translation Smoothing
Parameters
The Hamilton filter has 8 parameters split between rotation and translation:Rotation Parameters
Maximum rotation angle for full smoothing (degrees).
- Lower values: More aggressive smoothing, slower response
- Higher values: Less smoothing, faster response
Power curve exponent for rotation smoothing.
- Lower values (< 1.0): More linear response
- Higher values (> 1.0): Keeps heavy smoothing longer, opens up late
alpha = pow(alpha, rot_pow + rot_zoom)Rotation deadzone in degrees. Movements smaller than this are ignored.
- Too low: Visible jitter when trying to hold still
- Too high: Small intentional movements feel unresponsive
Translation Parameters
Maximum translation distance for full smoothing (centimeters).
- Lower values: More smoothing, slower positional response
- Higher values: Less smoothing, faster positional response
Power curve exponent for translation smoothing.
- Lower values: More linear response
- Higher values: Keeps heavy smoothing longer
Translation deadzone in centimeters. Movements smaller than this are ignored.
Zoom-Dependent Rotation
Additional rotation power when leaning back (negative Z).This creates more smoothing when you lean back, useful for reducing shake when observing distant objects.
Maximum Z distance (backward lean) for full zoom smoothing effect.The zoom contribution is calculated as:
Tuning Guide
For Smooth Cinematic Movement
Maximize smoothing for video recording or demos:Why these settings?
Why these settings?
- High max radius/distance = smoothing applied over large movements
- High power curves = keeps smoothing strong even during motion
- Moderate deadzones = eliminates jitter without feeling sticky
- Zoom smoothing = extra stability when leaning back to look at distance
For Responsive Gaming
Minimize lag while keeping quaternion benefits:Why these settings?
Why these settings?
- Lower max radius/distance = less smoothing overall
- Low power curves (< 1.0) = more linear, immediate response
- Small deadzones = don’t suppress intentional micro-adjustments
- Reduced zoom smoothing = maintain responsiveness when leaning back
Balanced (General Purpose)
Understanding Slerp vs Lerp
Slerp (Spherical Linear Interpolation)
Used for quaternion rotations:- Interpolates along the shortest arc on a 4D unit sphere
- Maintains constant angular velocity
- Prevents gimbal lock and axis flipping
- More expensive computationally than Lerp
Lerp (Linear Interpolation)
Used for position vectors:- Simple weighted average:
output = (1-alpha)*start + alpha*end - Sufficient for Cartesian coordinates
- Very fast computation
The quaternion representation is internal only. Input and output remain as Yaw/Pitch/Roll Euler angles for compatibility with OpenTrack.
Deadzone Behavior
The Hamilton filter implements “soft” deadzones:alphabecomes negative, clamped to 0- No interpolation occurs
- Output stays at current position
alphais very small- Slow interpolation begins
- Gradual transition, not a hard cut
alphaincreases toward 1.0- Faster interpolation
- Response speed depends on power curve
Zoom-Dependent Smoothing
The Hamilton filter includes a unique feature: rotation smoothing increases when leaning backward:Disable zoom smoothing
Disable zoom smoothing
Set
smoothing_power_zoom to 0.001 (minimum) to effectively disable this feature.Comparison to Other Filters
| Feature | Hamilton | Alpha Spectrum | EWMA | Accela |
|---|---|---|---|---|
| Rotation method | Quaternion Slerp | Per-axis EMA | Per-axis EMA | Per-axis spline |
| Gimbal lock | ✅ Impossible | ⚠️ Possible | ⚠️ Possible | ⚠️ Possible |
| Rotation path | Shortest arc | Axis-independent | Axis-independent | Axis-independent |
| Auto adaptation | ❌ No | ✅ Yes | ✅ Yes | ⚠️ Velocity-based |
| Parameters | 8 | 8+ | 3 | 4 |
| CPU usage | Low | Medium | Low | Low |
| Best for | Cinematic | Advanced tuning | Auto adaptation | Fast action |
When to choose Hamilton
When to choose Hamilton
Choose Hamilton if:
- You want artifact-free rotation interpolation
- You need consistent smoothing regardless of head orientation
- You’re making videos or demos and want cinematic movement
- You don’t need automatic noise adaptation
- You want automatic smoothing adjustment (use EWMA)
- You need minimal latency for competitive gaming (use Accela)
- You want advanced predictive filtering (use Alpha Spectrum)
Troubleshooting
Rotations feel sluggish
Rotations feel sluggish
- Decrease
max_radius_smoothingto 5.0 or lower - Decrease
smoothing_power_rotto 0.5 or lower - Reduce
dead_zone_radius_rotto minimum (0.001)
Still seeing rotation jitter
Still seeing rotation jitter
- Increase
max_radius_smoothingto 15.0 or higher - Increase
smoothing_power_rotto 2.0 or higher - Slightly increase
dead_zone_radius_rotto 0.05-0.1 - Check tracker mounting and ensure no external vibration
Translations feel different than rotations
Translations feel different than rotations
This is normal - the filter uses separate parameters for rotation vs translation.Adjust translation parameters independently:
max_distance_smoothingsmoothing_power_distdead_zone_radius_dist
Deadzone feels sticky
Deadzone feels sticky
Deadzones are probably set too high:
- Rotation deadzone should typically be < 0.1°
- Translation deadzone should typically be < 0.3 cm
Extra smoothing when leaning back is unwanted
Extra smoothing when leaning back is unwanted
Set
smoothing_power_zoom to minimum (0.001) to disable the zoom-dependent rotation smoothing feature.Implementation Details
Quaternion Conversion
Input Euler angles are converted to quaternions:Angle Calculation
Alpha Scaling
The line:- Alpha is scaled down proportionally to deadzone
- The filtered output never “jumps ahead” of the input
- Smooth transitions when entering/exiting deadzone
Code Reference
Relevant source files:- Implementation:
filter-hamilton/ftnoir_filter_hamilton.cpp - Header/settings:
filter-hamilton/ftnoir_filter_hamilton.h - Dialog:
filter-hamilton/ftnoir_filter_hamilton_dialog.cpp - Quaternion utilities:
compat/hamilton-tools.h
Key Functions
Rotation filtering (ftnoir_filter_hamilton.cpp:61-77):
ftnoir_filter_hamilton.cpp:29-46):
Next Steps
Filter Overview
Compare all available filters
Alpha Spectrum
Advanced adaptive filter
EWMA Filter
Automatic noise-adaptive filtering
Accela Filter
Velocity-dependent acceleration filter