Exemplo n.º 1
0
        public static void SetColorByImage(vtkPolyData data, vtkImageData image, Rectangle rect)
        {
            for (int i = 0; i < rect.Width * rect.Height; i++)
            {
                float c = image.GetScalarComponentAsFloat(i % rect.Width, i / rect.Width, 0, 0);
                data.GetPointData().GetScalars().SetTuple3(i, c, c, c);
            }

            data.Modified();
        }