VTK now has the vtkCoordinateFrameWidget
which controls 3 orthogonal, right-handed planes.
(see VTK MR)
The representation of the vtkCoordinateFrameWidget
can be seen below:
In more detail, the representation of the vtkCoordinateFrameWidget
has:
- The origin point of the coordinate frame widget is represented as a sphere.
- Three normal vectors of the three orthogonal planes which are represented as lines segments with a cone tip
- Three normal vector lockers are represented as (opaque) cone tips.
vtkCoordinateFrameWidget
supports the following actions:
- When you interact with a widget part, its color becomes ambient to give you feedback before you interact with the
widget - When you click on normal vector locker (the first cone tip of a vector), there are two possible 2 states: unlocked,
and locked- Locking an unlocked vector locker, it converts its color to non-opaque, and locks its plane
- If any other vector locker is locked, it becomes unlocked, since only one plane can be locked
- Unlocking a locked vector locker, converts its color to opaque, and unlocks its plane
- Locking an unlocked vector locker, it converts its color to non-opaque, and locks its plane
- When you click+drag the origin, you can translate the origin of the widget
- If no normal vector is locked, the origin moves on the plane of the camera
- If one normal vector is locked, the origin moves on the locked normal’s vector plane
- When you click+drag a vector tip (the second cone tip of a vector), the orientation of the widget changes
- If any normal vector is locked:
- When you click on the locked normal vector’s tip, nothing will happen
- When you click on one of the unlocked normal vectors’ tips, the orientation of the widget changes, but it’s
constrained to move only on the locked normal’s vector plane
- If any normal vector is locked:
- When you type ‘P/p’, it resets the origin of the widget to the picking point
- When you type ‘N/n’, it resets one of the vector normals to the picked normal
- If one normal vector is locked, the corresponding normal vector is set to the picked normal
- The remaining normals are re-orthogonalized using the Gram-Schmidt procedure
- if no normal vector is locked, the normal vector closest to the picking normal (i.e. with the largest dot
product) is set to the picked normal- The remaining normals are re-orthogonalized using the Gram-Schmidt procedure
- If one normal vector is locked, the corresponding normal vector is set to the picked normal
- When you type ‘D/d’, it resets one of the vector’s normal to the direction of a line from the origin to the picked
point- If one normal vector is locked, the corresponding normal vector is set to the direction of the line (as defined
above)- The remaining normals are re-orthogonalized using the Gram-Schmidt procedure
- if no normal vector is locked, the normal vector closest to the direction of the line (as defined above) (
i.e. with the largest dot product) is set to the direction of the line- The remaining normals are re-orthogonalized using the Gram-Schmidt procedure
- If one normal vector is locked, the corresponding normal vector is set to the direction of the line (as defined
You can test it using: test.cxx