[vtkusers] About drawing a cube

David Doria daviddoria at gmail.com
Wed Apr 18 11:17:51 EDT 2012


>
> Thank you very much for your codes !
>
> I have successfully realize to set the parameters of vtkCubeSource by 8
> vertices based on your codes. But I encounter another problem, it seems the
> order of 8 vertices should be arranged correctly, otherwise, the visualized
> cube is not correct. About the order of vertices, do you have an easy idea
> to set ? Otherwise, I need to check the coordinates of 8 vertices every
> time and re-order them.
>
> Greatly appreciate your help!
>

I would suggest coloring the vertices of the cube:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints

This will allow you to see the ordering that is produced by the CubeSource.
You will then have to rearrange your points to match this ordering, but
this must only be done once - once you know the mapping nothing new needs
to be done each time.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120418/021b3490/attachment.htm>


More information about the vtkusers mailing list