"Triangles"

David Sharp mailto:dsharp@interport.net

Here is a link to the web version of this page:www.oocities.org/Athens/Academy/8764/triangles.htm

Download (latest version: March 23, 2000)

Source code to Triangles
Source code posted here will usually be about two updates behind, until the development gets more stable. To compile (without modification of the code) you need to have installed DJGPP and the Allegro game library.


Table of Contents
Triangles is a free DOS program, distributed without warranties or guarantees. It is a "manual tri-mesh contruction utility" for making a mesh (mess?) of virtual triangles mainly using the mouse, and saving the result in a small choice of different formats (RAW , POV , PCM1, and Triangles's own TRI format).

Triangles is meant for modeling objects, not for producing images. It intended use is for making objects to be rendered using POV-Ray ray-tracing program. There is an upper bound on the number of triangles allowed (currently 50,000), so its main value is for modeling 'objects' rather than entire scenes. Even given the narrow niche Triangles is meant to fill, it is still missing many valuable features and I can't say that development will continue beyond what I personally need.

Setting up
Create a directory for Triangles. Unzip the downloaded zip file into this directory. To use under Windows, double click on the Triang.exe icon in Windows Explorer (or File Manager, or whatever), or get a DOS prompt and run Triang.exe. To use under plain DOS (not shelled to DOS from Windows), it is necessary to have the file CWSDPMI.EXE in your 'PATH', or in the directory you are running Triangles from. You will need to have video supporting 'at least' 640x480 pixels and 256 colors. You can set the video resolution to a few different settings using the Options Menu after Triangles starts. To have Triangles start up in a particular resolution (640x480, 800x600, 1024x768, 1200x1024, or 1600x1200), modify the file 'triangles.ini'. It must have one of the above copied literally into the first line of the file. To have Triangles always start in 1024x768, for example, modify (or create) the ASCII text file named 'triangles.ini' so that the first line is
1024x768
and make sure that your 'triangles.ini' is in Triangles's working directory.

Using Triangles
There are four view windows to see what you are doing. Three wire-frame views, and one '3-d' view. The wire-frame views are not adjustable (zooming or panning), but you can easily scale, rotate, or move your mesh around to get an appropriate view. The 3-d view presently uses the simplest "painter's algorithm" for rendering, and it can sometimes create false impressions, like triangles which seem to disappear when rotating, especially when the edge angles are large. Once the mesh has been smoothed some, the weirdness usually goes away. I may eventually add z-buffering to eliminate the problem, but maybe not.

Command Line
The Triangles command line can take the name of a TRI or RAW file to start up with. (This allows you to 'drag and drop' a file onto a Triangles icon). e.g.:
C:\Triangles>Triang.exe myfile.tri
would start Triangles with the file 'myfile.tri'.

Another command line option is how much memory to allocate for meshes. '-mN', where N is an integer, will make room for Nx1000 vertices, Nx1000 triangles, and 2N*1000 edges. e.g.:
C:\Triangles>Triang.exe -m100
would start Triangles with room for 100,000 vertices, 100,000 triangles, and 200,000 edges. The default (without using the command line option) is 50,000 vertices.

Mouse
The right mouse button in any of the three wire-frame view windows brings up a menu of "mouse choices". This is a list of things you can have the mouse do in the wire-frame views:

The right mouse button in the "3-d" view window brings up a menu of 3-d view "mouse functions". Note that rotations, translations, and scalings in the 3-d view have no effect on the actual mesh. That is, they should be considered as changing your viewpoint, not moving or rotating the mesh.

File menu

To use files/objects other than RAW or TRI files, you will first need to convert them to RAW triangles files (other than Triangles itself, no conversion programs exist to convert from TRI to other formats, unless you count Triangles itself). A couple of valuable 3D format conversion tools are Thomas Baier's 3DWin and Keith Rule's Crossroads. Here is a link to some other conversion utilities

Edit menu
To perform one of the 'edit' operations without opening the menu, hold down the control key (Ctrl) and hit the function's keyboard letter For example, Ctrl-'t' (hit 't' while Control key is pressed) will make a triangle from three selected vertices.