I have a question about the control of the polygon.

image

private void renderWindowControl1_Load(object sender, EventArgs e)
{

sphere.SetThetaResolution(8);
sphere.SetPhiResolution(20);

shrink.SetInputConnection(sphere.GetOutputPort());
shrink.SetShrinkFactor(0.9);

mapper.SetInputConnection(shrink.GetOutputPort());

actor.SetMapper(mapper);
actor.GetProperty().SetColor(0, 1, 0);

vtkRenderer ren1 = renderWindowControl1.RenderWindow.GetRenderers().GetFirstRenderer();
vtkRenderWindow renWin = renderWindowControl1.RenderWindow;

ren1.AddViewProp(actor);
renWin.SetSize(250, 250);
renWin.Render();
vtkCamera camera = ren1.GetActiveCamera();
camera.Zoom((double)1.5);

}

This is the code created using actviz.

My question is, it appears that the triangular polygons in the sphere are created and is it possible for me to choose one of each of these triangles to change the color and so on.

FYI @LucasGandel @alexy.pellegrini

2 Likes

Hi @ManInTheSouth! The code you shared is adapted from a very simple Activiz example that only demonstrates the use of the vtkShrinkPolyData filter in a WindowsForm application. If my understanding is correct, you would like to achieve cell picking in this example and highlight the picked cell. This could be achieved by combining existing VTK examples like CellPicking and ColorCellsWithRGB. Such example can be adapted to C# easily because the Activiz API is the same as VTK.
Hope this helps, feel free to contact me if you need further help.

1 Like

thank you for your answer