ModelScanner
Description
- Derived from
-
Disposable abstract
IValidatable
The ModelScanner class converts a 3D model to a heightmap.
Public / Methods
Scan
Creates a background operation than scans the 3D model and generates a heightmap dataset.
The following work is performed by the model scanner operation:
-
The 3D model is loaded from ModelReader, if necessary.
-
The 3D model is analysed in order to determine a suitable base geometry for subsequent scanning. Currently, the only supported base geometry is Geometry.Sphere.
-
The output dataset is created, using the given heightmap Size, the base geometry and a geo-reference for a spherical planetary terrain.
-
For each sample of the output dataset, a ray is cast along the inverted up-direction of the base geometry. Based on the intersection with the surface of the 3D model, a terrain elevation value is computed and stored in a temporary elevation dataset.
-
The temporary elevation dataset is copied to the output dataset, using a copy operation that blurs elevation values according to BlurElevation.
-
For each sample of the output dataset, a ray is cast along the normal vector of the terrain surface defined by the blurred elevation values. Based on the intersection with the surface of the 3D model, a terrain displacement value is computed and stored in a temporary displacement dataset.
-
The temporary displacement dataset is copied to the output dataset, using a copy operation that blurs displacement values according to BlurDisplacement.
-
The temporary elevation and displacement datasets are deleted.
- ValidatingException
-
If the model scanner settings are invalid.
Public / Attributes
BlurDisplacement
Amount of blurring to apply to the generated displacement values before copying them to the output dataset.
Defaults to 5
.
BlurElevation
Amount of blurring to apply to the generated elevation values before generating displacement values and before copying them to the output dataset.
Defaults to 50
.