The 3DS vconf file format

The 3DS vconf file format is quite simple. It uses varconf for its processing and follows its syntax. Each 3DS file uses this file to specify where the model can be found and a number of options to override what is specified in the model for it work render correctly in Sear.

Below is an example vconf file.

  filename = "${SEAR_MEDIA}/box/box.3ds"

  texture_map_0 = "texture_name"

The main section is the [model] and is required along with the "filename" entry. Texture maps can be overridden by specifying the material name in a section heading as above. The texture_map_ field in the material section is the name of a texture map to use. As usual, this name is an entry in the textures.cfg file.

In CVS Sear a number of additional options exist. In the model section, a scale and rotation can be specified. Scale is single value floating point and rotation is four floating point values separated by a semi-colon specifying the w, x, y and z components of a quaternion.

  filename = "${SEAR_MEDIA}/box/box.3ds"
  scale = "0.5"
  rotation = "1.0;0.0;0.0;1.0"

A number of options for scaling the object are now available in Sear. The first is a flag called scale_anisotropic which will scale the object to a unit cube. This is useful in combination with the scale_bbox flag in the model record. Alternatively the flag scale_isotropic will scale the object so the largest axis is unit length. This is more useful for the scale_height flag in the model_record. Additionally, there is are flags called scale_isotropic_x, scale_isotropic_y and scale_isotropic_z to specify which axis should be scaled to unity. Only one of these scale_ flags should be used at once. When one of these flags are in use, there are two other flags that can be specified. the z_align flag translates the object so that the minumum z value is zero. On the flipside, the ignore_minus_z flag ignore minus z values when rescaling. This is useful for objects that need to go below ground, but the bouding box stops at ground level.

There are also some additional material overrides. These changes allow specifying the ambient, diffuse, specular and shininess material values. With the exception of shininess (which is a single float) these values are represented by four floating pointer numbers delimited by a semi-colon representing the red, green, blue and alpha colour values respectivly.

    texture_map_0 = "texture_1"
    ambient = "1.0;1.0;1.0;1.0"
    diffuse = "1.0;1.0;1.0;1.0"
    specular = "1.0;1.0;1.0;1.0"
    shininess = "50.0"