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
![](https://www.weiy.city/wp-content/uploads/2019/04/9be5b71a-c3aa-491d-aa0c-b3ed7918747a.gif)