int tsmWriteVtile ( TsmConnection oiConnect, TsmConnection demConnect, int tx, int ty, int iLevel, TsmConnectionParams params ) Creates a single VRML vtile file
Creates a single VRML vtile file.Writes a single VRML vtile file at level iLevel and location (tx,ty). A vtile file contains all of the geometry and links to the texture map imagery for one tile in a multi-resolution pyramid. You supply a DEM and OI connection to provide the elevation and imagery data.
You can control the generation of the vtile through a number of optional parameters in the TsmConnectionParams structure. You can set these parameters with the tsmSetParam call. The following parameters are currently supported:
- TSM_PARAMS_VRML_DIR: The vtile file will be written to the vtile directory inside this localdisk directory. This parameter is required - you should always set this with before calling this function.
- TSM_PARAMS_VRML_URL: By default, all of the URLs that are inserted into the vtile files will be relative. However, you can specify an absolute URL for all vtiles to use (i.e. for the image file) by setting this parameter. The URL should be for the root directory of the dataset, e.g. http://www.ai.sri.com/VRMLSets/Yosemite.
- TSM_PARAMS_NUM_POLYS: This setting specifies the number of polygons on one side of a tile. Increasing this value will give smoother geometric models, but at the computational expense of more polygons per scene.
- TSM_PARAMS_GAUSSIAN: Use gaussian interpolation instead of linear when interpolating the elevation data.
- TSM_PARAMS_TEST_VTILES: Ignore the DEM and OI datasets and just create a flat vtile that is randomly coloured. This can be useful for seeing the level of detail mechanism in action.
- TSM_PARAMS_FLAT: By default, all coordinates will be projected into geocentric coordinates i.e. an (x,y,z) offset from the center of the earth. This will take into account the earth's curvature. If you just want to produce a flat dataset where all elevations are relative to a plane, then use this option. N.B. in flat worlds, all coordinates are specified in a Z-up coordinate system with embedded Transform nodes to convert these into VRML's Y-up coordinate system.
- TSM_PARAMS_FAST_BBOXES: By default, all bounding boxes will be calculated by taking the min and max of all coordinates in a tile. This can be a time consuming process and so we offer this alternative method which produces an approximation to a tile's bounding box but works much faster.
- TSM_PARAMS_NORMALS: If this parameter is set, then normals will be generated for all of the polyons in the vtile. This will produce smoother lighting effects.
- TSM_PARAMS_WORLD_SCALE: Every coordinate that is sent to the vtile file will be scaled (divided) by this value. A value of 1.0 means no scaling. This facility is useful because geocentric coordinates can be very large and some VRML browsers have problems with these large coordinates. Scaling the coordinates down to the 10-100 m range gives good results.
- TSM_PARAMS_ELEV_SCALE: Every elevation value will be multiplied by this value before projecting into the display coordinate system (e.g. geocentric). This allows you to introduce a vertical exaggeration into your models. A value of 1.0 means no vertical exaggeration.