[vtkusers] Stupid Mistake? Color a pointcloud...
Jérôme
jerome.velut at gmail.com
Thu Sep 22 03:49:03 EDT 2011
Hi Fabian,
1- In the example you pointed, there is a
"actor->GetProperty()->SetPointSize(5);"
Did you try to set point size to 1 ?
2- You try to "PointCloudPolyData->GetPointData()->SetScalars(Colors);"
whereas you declare a vtkDoubleArray named PointCloudColors. It could
be the reason, however without a short comprehensive code that
reproduces the error, it is not that easy to help...
HTH
Jerome
2011/9/22 Fabian <fabian-richter at gmx.de>:
> Dear vtk-users,
>
> I have a large file with geometry data and color data (lets say a colored
> pointcloud)
>
> Now I want to visualize it. To get the geometry -> No Problem! (looks pretty
> nice!)
> But when I want to assign the color values to the points I just fail! :(
>
> I tried to work with some examples:
> 1) the colored point example "enlarges" my points (sets vertices?!) so they
> all are tiny squares. Thus I cannot use the visualization because it is
> getting blurred. (Example:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints)
>
> 2) I found quite the same problem discussed here some time ago. There is
> given this example:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars
> But when I try to use this method, my compiler (visual studio 2010) say
> "pointer to incomplete class is not allowed!" when I try to set a
> vtkDoubleArray as scalar values.
>
> Looks like this:
>
> vtkSmartPointer<vtkDoubleArray> PointCloudColors =
> vtkSmartPointer<vtkDoubleArray>::New();
>
> [Set all the points in polydata, set all the colors (it is in the same loop
> so I am pretty sure, that the numbers of values are equal)]
>
> PointCloudPolyData ->SetPoints(PointCloudPoints);
> PointCloudPolyData ->SetVerts(PointCloudCellArray);
> PointCloudPolyData ->GetPointData()->SetScalars(Colors); //here comes
> "pointer to incomplete" error
>
> Now this could mean two things:
> Either I didnt understand the concept or I just did a stupid mistake! In
> both cases I need Your help!
>
> Thanks a lot,
> Fabian
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Stupid-Mistake-Color-a-pointcloud-tp4829262p4829262.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list