Odd color problem with vtkCubeAxesActor

Working with the online example:

I added the following lines to show inner grid lines and set the ones for the X axis to a red-like color plus setting the axes to a black:

cubeAxesActor->GetXAxesLinesProperty()->SetColor(0.1, 0.1, 0.1);
cubeAxesActor->GetYAxesLinesProperty()->SetColor(0.1, 0.1, 0.1);
cubeAxesActor->GetZAxesLinesProperty()->SetColor(0.1, 0.1, 0.1);

cubeAxesActor->GetTitleTextProperty(0)->SetColor(0.1, 0.1, 0.1);
cubeAxesActor->GetTitleTextProperty(1)->SetColor(0.1, 0.1, 0.1);
cubeAxesActor->GetTitleTextProperty(2)->SetColor(0.1, 0.1, 0.1);

cubeAxesActor->GetXAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);


As one rotates the “object” the red inner grid lines change to green (must be default) and then back to the red and so on. This is really odd behavior and shouldn’t happen. I expect the inner grid lines to stay with the color to which they were set.


Can you try this:

cubeAxesActor->GetXAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);
cubeAxesActor->GetYAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);
cubeAxesActor->GetYAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);

This way you will get red grid lines independently of orientation, if I understood your problem right.

take care,