[vtkusers] Display Pointcloud in 3d

h0ppel h0ppel at web.de
Fri Jan 6 04:55:03 EST 2012


Hi,

I do have an example point Cloud and put it into imagedata like this:

int i, j, k;

            int[][][] Matrix;
            var rand = new Random(100);

            var x = 100; var y = 200; var z = 35;
            var size = x * y * z * sizeof(int);

            Matrix = new int[x][][];

            for (i = 0; i < x; i++)
            {
                Matrix[i] = new int[y][];

                for (j = 0; j < y; j++)
                {
                    Matrix[i][j] = new int[z];

                    for (k = 0; k < z; k++)
                    {
                        Matrix[i][j][k] = rand.Next();
                    }
                }
            }

            vtkImageData image = new vtkImageData();

            image.SetDimensions(100, 200, 35);
            image.SetSpacing(1, 1, 1);
            image.SetOrigin(0, 0, 0);
            image.SetNumberOfScalarComponents(1);
            image.SetScalarTypeToFloat();
            image.AllocateScalars();

            unsafe
            {
                int* ptr = (int*)(image.GetScalarPointer());

                for (i = 0; i < 100; i++)
                {
                    for (j = 0; j < 200; ++j)
                    {
                        for (k = 0; k < 35; ++k)
                        {
                            *ptr++ = Matrix[i][j][k];
                        }
                    }
                }}< /raw>            

but how can I display this cloud in 3d and not only in the viewer?

thanks

--
View this message in context: http://vtk.1045678.n5.nabble.com/Display-Pointcloud-in-3d-tp5125086p5125086.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list