This post is similar to 【VTK】A SIMPLE EXAMPLE WRITTEN IN C++.
We use TCL script to do the same thing: create and show cone in 3D world with the virtualization tool kit.
TCL script:

package require vtk

vtkConeSource cone

vtkPolyDataMapper coneMapper
coneMapper SetInputConnection [cone GetOutputPort]

vtkActor coneActor
coneActor SetMapper coneMapper

vtkRenderer ren1
ren1 AddActor coneActor
ren1 SetBackground 0 0 0

vtkRenderWindow renWin
renWin AddRenderer ren1

vtkRenderWindowInteractor iren
iren SetRenderWindow renWin

# Withdraw the default tk window
wm withdraw .

iren Start

Run the script:vtk tclTest.tcl

Categories: TCLVTK


Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page