Export Basemesh

From GMLwiki

Jump to: navigation, search

It is possible to export generated geometry in form of a base mesh into a file similar to the obj file format.

To write the currently visible scene to a file, just put a filename in form of a string on the stack and call savemesh. This has been tested with TestGML.exe, Version 165, on WindowsXP.


...

"example.obj" savemesh

As the base mesh consists of two kinds of edges, the file format had to be changed slightly. Extra edge data is stored in the face indices desciption:

f a//2 b//1 c//1 d//1

For this example the face a,b,c,d has one sharp edge a,b (marked with 2) and 3 smooth edges (marked with 1). Obviously no normals and no texture coordinates are exported in this way.

Exported meshes can also be imported again using loadmesh:


deleteallmacros clear newmacro pop
pnm-clear

"example.obj" loadmesh

For the OpenSG SubSurface Node there exists a tool to convert the file to some matching file format (also an obj variation).

Personal tools