# VRML Server The VRML Server allows clients to retrieve sceneshots of 3D models on the filesystem in a variety of formats. ## General Mode of Operation The VRML server will monitor its vrml directory recursively for vrml and wrl files. Whenever such a file is found, it is converted into a native, binary representation and saved in the tmp directory. Clients can now access sceneshots of this model by specifying the desired pose and format. ## Accessing Sceneshots In the simplest case, a sceneshot is retrieved by simply requested its respective URL on the VRML server: http://host/vrml/HARD_MP_VAL_000.png All paths start with vrml and then reflect the vrml directory structure as it is being monitored. When a directory foo was added (either by creation or linking) in the vrml directory, its 3D models will be available at: http://host/vrml/foo/FANCY_MODEL_000.png When you do not pass any parameters, you will get a sceneshot of the model with its largest, axis aligned surface area facing the camera. That is, the model will be rotated by multiples of 90deg to show the side of the bounding box which has the largest surface area. The implied assumption is that this side is suited to identify the model and its eventual problems the quickest. If you do not like the standard sceneshot, you can pass a couple of parameters to adapt most aspects of the scene:
NameRangeDescription
pitch[0 .. 2π] radRotation along the x-axis
roll[0 .. 2π] radRotation along the z-axis
yaw[0 .. 2π] radRotation along the y-axis
zoom[0 .. ∞] bounding-sphere unitsDistance of camera to model center
x[-∞ .. ∞] OpenGL unitsTranslation on x-axis
y[-∞ .. ∞] OpenGL unitsTranslation on y-axis
z[-∞ .. ∞] OpenGL unitsTranslation on z-axis (consider using zoom instead)
width[0 .. BIG] pixelsThe width of the image (limited by your GPU)
height[0 .. BIG] pixelsThe height of the image
autorotate[on | off]Whether or not to autorotate first
http://host/vrml/HARD_MP_VAL_000.png?pitch=0.3&width=2560&height=1600 There are some caveats: ## REST API The main purpose of the REST API is to provide clients with a list of available model files.
PathTypeReturn ValueExample
/vrml GET A JSON structure identifying all known models in the hierarchy as found on the filesystem.
The entries are organized in a tree, reflecting the original locations relative to the vrml directory. The suffix of png is just one example, supported extensions are ultimately defined by the available OSG writer plugins, but limited for now to gif, jpg, png, tif and bmp.
{
  "models": {
    "HARD_MP_VAL_000": {
      "path": "/HARD_MP_VAL_000.png", 
      "url": "http://host/vrml/HARD_MP_VAL_000.png"
    }, 
    "HARD_MP_VAL_001": {
      "path": "/HARD_MP_VAL_001.png", 
      "url": "http://host/vrml/HARD_MP_VAL_001.png"
    }, 
    "data": {
      "SOFT_MP_VAL_000": {
        "path": "/data/SOFT_MP_VAL_000.png", 
        "url": "http://host/vrml/data/SOFT_MP_VAL_000.png"
      }, 
  ...
/vrml/models, /vrml/wrls GET A JSON structure with information about the available binary model files in the tmp directory or the wrl files in the vrml directory respectively.
The entries correspond to the tree at /vrml but all paths are flattened using the path delimiter (':' per default).
{
  "HARD_MP_VAL_000": {
    "atime":        1363002503, 
    "ctime":        1362521747, 
    "dir":          "/tmp", 
    "extension":    "osgb", 
    "group":        "/", 
    "mtime":        "1362521747", 
    "name":         "HARD_MP_VAL_000.osgb", 
    "path":         "/tmp/HARD_MP_VAL_000.osgb", 
    "relDir":       "/", 
    "relPath":      "/HARD_MP_VAL_000.osgb", 
    "size":         "580201", 
    "strippedName": "HARD_MP_VAL_000"
  }, 
...
/vrml/processed GET A JSON structure with information about the sceneshots that were requested recently and are still on disc.
The individual entries within a model key encode the request parameters seperated by underscores, that is:
The euler angles pitch, roll, yaw, zoom, translation in x, translation in y, translation in z, width, height, and whether or not to autorotate.
{
  "HARD_MP_VAL_000": {
    "0.94_0_0_1_0_0_0_640_480_on.png": {
      "atime":        1363002687, 
      "ctime":        1363002687, 
      "dir":          "/tmp", 
...