how to set the color of a triangle?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to set the color of a triangle?

Szabolcs Berecz

I would like to frequently change the color and/or the transparency of
several triangles,
but I don't know what is the best practice. Actually I don't have any
idea how to change
the color of a triangle.

To create the surface, first I put the vertices into a vtkPoints, then
put the index of the
vertices into a vtkCellArray. At the end I pass it to a vtkActor through a
Is it supposed to be done like this?
How can I change the color of one of the triangles?
Do I have to create a separate vtkActor for each triangle?
If I use a separate vtkActor for each triangle, can I somehow share
the vertices between
the triangles?

So in brief: What is the best practice to render a bunch of connected
triangles with
frequently and independently changing colors? (the position of the
vertices will also
change, but I think I can solve that)

Thanks for your help!

This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
Follow this link to subscribe/unsubscribe: