VTK Examples

There has been a rewrite/upgrade of the CameraOrientationWidget example.

There is a new C++ version and a new PythonicAPI version. WASM now works with the C++ version.

These two new versions take into account all the recent changes to the vtkCameraOrientationWidget, namely, axes labels and colors along with the positioning of the widget can now be easily changed.

The code demonstrates how to to automatically change axes labels and colors depending upon the object being viewed. You can also reposition the widget, the option -r repositions the widget to the upper right corner.

The code for setting up labels, colors and making the widget has been moved into functions to make it easier to implement in your own code. Note that, where colors are used, we pass the original vtkNamedColors object from main() to these functions. This is to ensure that if you define your own colors then these can be easily passed into these functions.

Look at the history section at the end of the description to see the relevant MRs corresponding to when these improvements were introduced.

Thanks to Jaswant Panchumarti and Shelly Belsky for making this a really useful widget.

Enjoy

3 Likes

That’s awesome, thank you, Andrew!