How a 3D file is written

This page was last modified on the 1st of June, 1997.

To understand how a volume can be managed by a computer program, we shall take as an example this simple shape:

The renderized structure

Click on the picture or here to see that shape in VRML.

It is a very simple shape indeed, as its structure is exactly the same if you look at it from above, from the sides or from behind. In other words, it will be easy to determine the x, y and z coordinates of the angles of that shape.

Thrice the same structure

Although that form seems to be a solid, modeling packages and 3D browsers only consider it as the association of the areas of its surface:

Exploded sides

Each of these areas will be completely defined if we exactly know the x, y and z coordinates of the points that are in the angles of each area. Please notice that the same angle point belongs to the perimeter of various areas at the same time.

To identify each of the vertices (points) of that shape, we will give each of them a single number, beginning at the base of the shape and then going upwards.

Inferior vertices Superior vertices

So it would become something like that:

Point 1, x = 4, y = 4, z = 0.
Point 2, x = 4, y = 2, z = 0.
Point 3, x = 2, y = 2, z = 0.
Point 4, x = 2, y = 4, z = 0.
Point 5, x = 4, y = 6, z = 2, etc.

That having been done, it is easy to describe any of the areas of the envelope, simply by giving the numbers of the vertices in its angles. These numbers must be given in a logical order, clockwise or counterclockwise. Once again, it is a good policy to begin at the bottom and then to go upwards.

The points in parallels

And that would become:

Side 1, points 1, 2, 3, 4.
Side 2, points 1, 5, 6.
Side 3, points 1, 6, 7, 2, etc.

That's it. You can click here to read the whole description of the form in the VR Cocha format, which uses exactly that logic we just explained. As this format was defined in Bolivia, you'll notice the Spanish words "puntos" (points, vertices) and "lados" (sides) among the lines.

The 3D Studio format is a little more talkative, but it obviously uses the same logic. Just notice that the list of numbers begins with 0 and not with 1, and that square areas were divided into two triangles (the reason is that the software can always be sure that three points belong to the same plane, while it is not so obvious with quadrangular perimeters).

The object seen by Netscape

In the VRML format, the logic is once again similar, but there are small differences: VRML does not consider useful to write a number for each vertex (the place in the list is considered a sufficient information). A little more difficult to understand, VRML considers that the second coordinate is given in reference with an upwards axis (for other softwares, the vertical coordinate is generally the third one). These differences are not big, but they are sufficient to make the manual translation from one format to another extremely boring.

The object seen by AutoCAD

The logic of the AutoCAD DXF format is not very different, but AutoCAD uses an enormous number of lines for very little information.

The object seen by TrueSpace

Other packages use other syntaxes, but generally the logic is more or less the same. For instance, you may have a look to the description of our shape in the Caligari TrueSpace format. TrueSpace is the package we use here to make the pictures of our creations.

The object seen by RayDream Designer

There's no general rule without exceptions: some packages do not define perimeters in reference with a compact list of vertices; they describe every perimeter with all its coordinates. For instance, that is what Ray Dream Designer does.

Once again, although the information used by various packages is exactly the same, this may lead to an enormous work when translating manually from a format to another. On the countrary, if you have the capacity to write a simple translating program (and we do that in Basic), you may forget most of the compatibility problems.

In the VR Cocha club, all the members do not use the same software, and we do not even talk about the topic. As it would have been extremely difficult, boring and unpleasant to waste our energy writing a complete set of translators, we decided to define a very simple format, and to write a single program that would translate it to any other software format, as long as a member would need it.

For the present time, we translate the VR Cocha format to VRML, 3D Studio and Caligari COB. Caligari itself can translate the result to AutoCAD DXF, which is understood by practically any modeling software nowadays. So far, we do not need more. But we are confident that we shall be able to add a few lines to our translation program if a new important format were to appear in the future.

For that reason, although the VR Cocha format is only used by the members of this club, the existence of the translator gives us the certainty that we shall always be able to translate it to any useful format, including the future ones. The pictures and listings on that page demonstrate that this is true. For the present time already, our capacity to produce easily correct VRML files allows us to be among the most creative VRML fans on the Web.

That is the reason why we decided to publish our format specifications and our VR Cocha-to-VRML and VR Cocha-to-3D Studio translator. Have a look to our work and our methods, and don't be afraid to try to use them. Even if you are not at all satisfied with our format, you can be sure that you will have the opportunity to translate everything that you'll create to VRML and 3D Studio, even if your knowledge of Basic is far from complete.

Back to the VR Cocha home page
This page hosted by Get your own Free Home Page