[vtkusers] Cloud of colored points

Francois Bertel francois.bertel at kitware.com
Mon Aug 16 16:11:29 EDT 2010


Hi  George,

if your scalars are unsigned char, and the scalar visibility flag is
on (default value) on the mapper, it should skip the lookup table and
use your color directly.
Make sure you set the color on vtkProperty to white expressed in
normalized values between 0.0 and 1.0 (1.0,1.0,1.0).

It seems you set the color on the vectors. Set the colors on the
scalars. It sounds weird but "scalars" in VTK can have up to four
components for encoding RGBA colors.

polydata.GetPointData().SetScalars(self.colors) should solve your issue.

Have fun with irradiance caching.

On Mon, Aug 16, 2010 at 4:00 PM, George Laskowsky
<georgelaskowsky at gmail.com> wrote:
> Hi, I am a new user to vtk, be nice :)
> What I am trying to do is to visualize the output of a raytracing program,
> specially the output of an algorithm, Irradiance Caching. What I have is a
> list of lots of points, each with it's own rgb value.
> I tried using vtkVertex.
> The way I have do it is to create both a vtkPoints and a
> vtkUnsignedCharArray, for position and colors respectively. I assign the
> color vector with polydata.GetPointData().SetVectors(self.colors) method.
> The only color I see is the default one (white) or the one I assign through
> actor.GetProperty().SetColor(color).
> I am working with Python in Linux, if that info is relevant.
> I know I can do other things like using voxels, or one actor ¡per point!,
> but it don't think that is very efficient.
> The number of points its in the order of hundred of thousands.
>
> Thanks for your help, if you need any more info, please, just tell me.
>
> P.S: I have read some docs and a lot of past posts. There have been similar
> inquiries, but no solution has work for me (like coloring with scalars
> values and a look up table, I need a different rgb value per point, and
> there are lots).
>
> --
> George Laskowsky Ziguilinsky
>
> _______________________________________________
> 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
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list