As decided a long time ago, there will be an attempt to provide a standard platform for the whole of our group to facilitate sharing of software and avoid maintainance of multiple (often equivalent) pieces of code. This page is the first step towards that direction. As a basis for this standard platform we have selected, for various reasons, the Dive data structures and so the libraries to be posted here will operate on those. However, during the necessary transition period, some functions based on Mels 3D library (3Dlib) will also be put here.
Two libraries are provided:
libdivevrml.a (SUN binary, SGI binary)
It provides the function world_t *read_vrml_world(char *filename), which takes as argument the name of the vrml file, constructs the Dive
object hierarchy and returns a pointer to the top-most node (the world).
To use, you need to include the divevrml.h file. This relies on several dive .h files, these can be fount here
libvrmlconv.a (SUN binary, SGI binary)
This is essentially the same as the library above with an additional function
to convert the Dive hierarchy to the 3Dlib format. It provides the function GObject *read_vrml_world_plus(FaceArray **facearray, char *filename). Which reads the vrml file indicated by filename and returns the root of the object hierarchy. The facearray is initialised to hold exactly the number of faces in the scene (not more).
To avoid warnings, include the file vrmlconv.h. Even though the Dive hierarchy is constructed, this is hidden and hence
you need not include any of the Dive header files. The memory allocated
for Dive is not automatically freed, the function clean_dive_db() is provided
for this purpose.
Problems with libvrmlconv.a
Source code
The uncompiled code with two simple examples, one for each of the above libraries, is also available. Read rhe README file that comes with the source for directions on the compilation.
Environment variables
If the vrml files are located in a directory other than the current, either specify the filename using the full path or set the environment variable RENDERER_DATA_PATH to point to the vrml director, eg:
setenv RENDERER_DATA_PATH $HOME/vrml_dir
To avoid the warning about not finding the materials file, set the environment variable DIVEPATH as normal (this will be fixed when we get the new parser from SICS).
Version0
This is almost identical to the existing Dive rendering but with the threads networking and callbacks removed (the callbacks will be restored soon).
.
Please feel free to use, modify or add to these modules and let me know of any additions/improvements you make so that I can add them here.
Yiorgos, 1st May 97.