3D Attitude Cube
The 3D Attitude Cube shows attitude in a three-dimensional scene. The cube rotates with the roll, pitch, and yaw angles. You can also load a custom model to replace the cube. A typical use is checking the orientation of a drone, gimbal, or robot.
Compared with the Attitude Indicator, which shows only roll and pitch, this plugin adds a yaw angle and displays the attitude in 3D.
Data Requirements
The plugin always needs three values. The table lists them in the order they must be sent.
| Position | Meaning | Unit | Rotation axis |
|---|---|---|---|
| 1st | Roll angle | Degrees | Scene X axis, the red arrow |
| 2nd | Pitch angle | Degrees | Scene Y axis, the green arrow |
| 3rd | Yaw angle | Degrees | Scene Z axis, the blue arrow |
- The three angles rotate about fixed scene axes in this order: first roll about the X axis, then pitch about the Y axis, and finally yaw about the Z axis.
- The direction of a positive angle follows the right-hand rule.
- The plugin does not limit angles. Values beyond ±180° still rotate the cube. For example, 190° and -170° show the same orientation.
- If there are more than three values, only the first three are used. If there are fewer than three, the whole data item is ignored.
- If a value is a missing value (it cannot be converted to a number, which gives NaN), that angle keeps its previous display and the other angles still update. The plugin does not filter infinite values, so the sender should avoid sending
inf.
Data Source
The general rules for Text Split and Variable Rendering are described in the Plugins Overview. This section covers only how this plugin uses the values from each method.
Text Split (Default)
- The first, second, and third values in the received text are assigned to roll, pitch, and yaw, in that order.
- Example: with the Prefix empty and the Separator set to
,, receiving12.5,-3.2,90shows roll 12.5°, pitch -3.2°, and yaw 90.0°. - With the Prefix set to
$ATT,,$ATT,12.5,-3.2,90is used, and data that does not start with that prefix is ignored.
Variable Rendering
- Check at least three numeric variables. The first three variables in the list, from top to bottom, are assigned to roll, pitch, and yaw. The order in which you checked them does not matter. If more than three are checked, only the first three are used.
- If only two variables are checked, there are not enough values, and the display does not update.
- While variable mode is on, the variable list is locked. To change the checked variables, turn variable mode off first. When variable mode is turned off, Refresh mode returns to Refresh on receive.
- When variable rendering is on, the channel names in the bottom readout change to the names of the selected variables.
Channel Settings
The plugin has three fixed channels: Roll, Pitch, and Yaw. In the Channels window, the Add and Remove buttons are disabled, so the number of channels cannot change.
- You can edit the name of each channel. The name appears in the bottom readout. For example, renaming Roll to Bank changes the readout to "Bank: 12.5°".
- Unit, Color, and Show this channel have no effect on this plugin. The readout always uses degrees (°). The colors of the cube and arrows do not change with the channel color, and all three angles are always shown.
- The window does not show the range minimum and range maximum fields.
- When variable rendering is on, the channel names in the window change to the names of the selected variables, and they cannot be edited.
Display
- The default geometry is a blue cube with three colored arrows extending from its center. In the default view, the red X arrow points right, the green Y arrow points up, and the blue Z arrow points toward the viewer. The cube and arrows rotate together with the attitude.
- The background is light gray and white, and the ground is a light gray grid. The grid does not rotate with the attitude and serves as a spatial reference.
- The camera distance adjusts automatically to the aspect ratio of the panel. When you resize the panel to any shape, the whole scene stays visible.
- The bottom readout shows the three angles with one decimal place, for example "Roll: 12.5° Pitch: -3.2° Yaw: 90.0°". Before any data arrives, or after the data is cleared, the readout shows
--, and the cube returns to a level attitude with all three angles at 0.
Toolbar
| Icon | Button | Description |
|---|---|---|
| Channels | Opens the Channels window to edit the names of the three channels. See Channel Settings above. | |
| Model | Opens a file dialog to choose a .obj, .gltf, or .glb model file. After the model loads, it replaces the default cube. See Custom Models below. | |
| Reset | Removes the loaded model and returns to the default cube and arrows. | |
| View | Checkable. When checked, Free View is on, and you can drag the mouse to rotate the view and scroll the wheel to zoom. When unchecked, the view stays at a fixed top-down angle. | |
| Variable | Checkable. When checked, variable rendering is on. Opens the Variable rendering settings window, which has the Enable variable mode checkbox, the variable list, the Refresh mode option, and the refresh interval. | |
| Text | Checkable. When checked, text split is on. It is on by default. Opens the Text split settings window, which has the Enable text mode checkbox, Prefix, Separator, and a preview example. | |
| Help | Opens this plugin's online help page in your browser. |
Custom Models
- Click Model and choose a
.obj,.gltf, or.glbfile. After the model loads, the default cube and arrows are hidden, and the model is shown instead. - The longest edge of the model is scaled to a fixed size, and the center of the model is placed on the rotation center of the attitude.
- The plugin does not convert the coordinate axes of the model. The orientation defined in the model file directly affects the display. If the display direction does not match what you expect, adjust it in the model file.
- If loading fails, a tooltip appears with "Model load failed:" followed by the error reason, and the default cube is shown again.
- If the 3D scene is not ready, clicking Model shows the message "3D scene is not ready, cannot load model".
- Clicking Reset removes the model. The plugin remembers the current model path, so the model loads again when the panel is shown after being hidden.
Free View
- When View is checked, drag the mouse in the panel to rotate the view, and scroll the mouse wheel to zoom.
- Attitude data changes only the orientation of the cube or model. It does not change the view.
- Free View is off by default. When View is unchecked, the view and zoom return to the default top-down angle.
- If the panel is hidden while Free View is on, the rotation angle and zoom are kept when the panel is shown again.
Notes
- When you switch tabs or the panel is hidden, the 3D view is recreated when it is shown again. The attitude, model, and Free View settings are kept.
- The plugin does not throttle updates. Each valid data item updates the scene, so high-frequency data increases CPU usage.
- If the 3D scene cannot load because the Qt Quick 3D module is not installed correctly, the panel shows a loading error. The bottom readout still updates, but the cube does not rotate.
- When both Text Split and Variable Rendering are off, the plugin splits received text by English commas.
