thanks for taking the time to share this example with me.
Actually, as you guessed in your message, I was already able to change the text color. What I would like to achieve is changing the color of the “faces” of the cube, and I didn’t find an easy way to do this.
What I imagined to do was to associate cell data to the cube source, and then maybe apply a LUT on cell data on the mapper. In addition to being complex, this doesn’t even seem to be possible, as the cubeSource is not accessible on my vtkAnnotatedCubeActor instance…
Moreover, setting this LUT on my mapper could even have other side-effects…
Anything simpler?
Any further hint would be greatly appreciated.
Best regards,
The best solution I could think of is to compose the letters from the vtkAnnotatedCubeActor with a basic cube actor of the same size with colored faces. In order to do that, you should:
Hide the annotated cube faces by setting it’s opacity property to 0
Create an array to hold the six colors for the faces
Create a actor based on the vtkCubeSource setting its CellData Scalars to use the color array
Merge the vtkAnnotatedCubeActor and colored actor using vtkPropAssembly
Use the vtkPropAssembly output as your marker for the vtkOrientationMarkerWidget
I tried to simplify the coloring part, to avoid difficulties for you to choose what colors go in what faces:
I would like to really thank you very much for taking the time to provide such a complete reply to my post: your suggestion is very smart, and it works indeed!
For those working with Java (like me), I would just like to mention that some of the methods that you used on vtkUnsignedCharArray are not available, hence here is the Java equivalent of that portion:
Thanks!
If you consider that this would be a useful contribution, I would be interested in seeing how you did it afterwards, since I don’t know how to do it.