TCL/TK Tutorial
Part 3

TCL/TK Part 3: Using 3Dem, Terragen, and 3DWin to create Object files.

Download the following files:


Install 3dem and Terragen:

Expand and run setup from the 3dem157 folder created..

Expand and execute SETUP.EXE from the tginstall0844 folder created. Install it to C:\Program Files\Terragen.

Copy TGPGuiLib.DLL and For_Export_Only.tgp into the folder C:\Program Files\Terragen. Then run Terragen and go to landscape window and click on accessories. There should be a list of things there, if it says “no accessories loaded” then the files TGPGuiLib.DLL and For Export Only.tgp were not placed in right folder.



Run 3Dem, click on the “file” button then “Load Terrain Model” then choose “USGS DEM” then select “cedar_city_w.dem” from where you unzipped it.

After the terrain has loaded click on it there will be a small box that you can move or resize.

Choose area that you want to save and then click on the “file” button, go down to “Save Terragen Terrain”, and then choose “Selected Area”.

Now run Terragen and then on the landscape window click on open and load the new terrain that you just saved.

In the landscape window click on the Landscape setting it is under the picture of land it has X amount of meters. You must change the size of the landscape very low ex. 100 to 200 meters. If the setting is too high TCL will have a hard time running it.

Now click on accessories and choose “F.E.O. Wavefront OBJ”
This will save your terrain to an Object file.

Terragen does not create everything in the Object file that TCL needs to run it so you have to use the 3DWin program that you installed in the previous tutorial.

Import the object file you just created in Terragen into 3DWin and then export it to a Wavefront OBJ file under a new name this will correct the file.

Open the file test.tcl with notepad and change the “test.obj” with the name of the Object file that you have just created from 3DWin save test.tcl then run it.

C++ Tutorial
Python Tutorial
TCL/TK Tutorial

About Us

TCL/TK Tutorial
Part 1: Installation
Part 2: Molecules
Part 3: Terrain
Part 4: Interactive
Part 5: Shapes