[vtkusers] Coloring a parametetirc surface?

Bill Lorensen bill.lorensen at gmail.com
Thu Apr 22 08:25:27 EDT 2010


The parametric source is generating scalar point data. By default the
mapper will use the point data if present.
Try,
boyMapper ScalarVisibilityOff


On Thu, Apr 22, 2010 at 7:10 AM, motes motes <mort.motes at gmail.com> wrote:
> I have this .tcl script (renders a Boy surface):
>
> # ------------------------------------------------------------
> # Call the VTK Tcl packages to make available all VTK commands
> # ------------------------------------------------------------
>
> package require vtk
> package require vtkinteraction
>
> # ------------------------------------------------------------
> # Create a Boy surface
> # ------------------------------------------------------------
>
> vtkParametricBoy boy
>
>
> vtkParametricFunctionSource boySource
> boySource SetParametricFunction boy
> boySource SetScalarModeToV
>
> vtkPolyDataMapper boyMapper
> boyMapper SetInputConnection [boySource GetOutputPort]
> boyMapper SetScalarRange -1 1
>
> vtkActor boyActor
> boyActor SetMapper boyMapper
>
>
> # Setting color does not work!
> [boyActor GetProperty] SetColor 1 0 0
>
> # ------------------------------------------------------------
> # Create the RenderWindow, Renderer and Interactor
> # ------------------------------------------------------------
>
> vtkRenderer ren1
> ren1 SetBackground 0.7 0.8 1
>
> vtkRenderWindow renWin
> renWin AddRenderer ren1
> renWin SetSize 800 800
> renWin SetWindowName "Boy surface"
>
> vtkRenderWindowInteractor iren
> iren SetRenderWindow renWin
>
> # add actors
> ren1 AddViewProp boyActor
> iren AddObserver UserEvent {wm deiconify .vtkInteract}
> iren AddObserver ExitEvent {exit}
>
> renWin Render
> boyActor SetPosition 0 0 0
> [ren1 GetActiveCamera] Zoom 1.5
>
> # prevent the tk window from showing up then start the event loop
> wm withdraw .
>
>
>
>
> Now I would like to change the color of the surface therefore I do:
>
> [boyActor GetProperty] SetColor 1 0 0
>
>
> But I has no effect, any ideas?
> _______________________________________________
> 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