Click or drag to resize
Ab4d.SharpEngine logo

HeightMapSurfaceNode Class

HeightMapSurfaceNode class is used to render the surface of a height map.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.SceneNodes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public class HeightMapSurfaceNode : ModelNode

The HeightMapSurfaceNode type exposes the following members.

Constructors
 NameDescription
Public methodHeightMapSurfaceNode(String)Initializes a new instance of the HeightMapSurfaceNode class
Public methodHeightMapSurfaceNode(Vector3, Vector3, Single, Boolean, Single, Single, String)Initializes a new instance of the HeightMapSurfaceNode class
Top
Properties
 NameDescription
Public propertyCenterPosition Center position of the height map surface Default value is (0, 0, 0).
Public propertyHeightData 2D array defining the height data. The dimensions of array also determine the size of the mesh (scaled by the X and Z components of the Size property). If no height data is provided, a flat surface (a plane) is generated. Default value is null (no height data available).
Public propertyHeightDataMaxValue Gets the maximum value from the HeightData array.
Public propertyHeightDataMinValue Gets the minimum value from the HeightData array.
Public propertyMaxTextureHeight Used to define custom height range for texture coordinates. Applicable only if UseHeightValuesAsTextureCoordinates is set to true. Default value is Single.NaN (disabled).
Public propertyMinTextureHeight Used to define custom height range for texture coordinates. Applicable only if UseHeightValuesAsTextureCoordinates is set to true. Default value is Single.NaN (disabled).
Public propertySize Size of the surface. X and Z components scale the 2D shape's width and height, while Y component scales the height values. Default value is (1, 1, 1)
Public propertyUseHeightValuesAsTextureCoordinates Use height values to generate texture coordinates. If disabled, texture coordinates are generated so that the texture is aligned with the dimensions of the surface. If enabled, texture coordinates are based on height value, which is useful for gradient-based textures. Default value is false.
Top
Methods
 NameDescription
Public methodStatic memberCreateHeightDataFromImageData CreateHeightDataFromImageData method creates a two dimensional array from the specified imageData that can be used for the HeightData property. The supported image formats are R8G8B8A8Unorm, B8G8R8A8Unorm (32 bit where height value is average value of red, green and blue color values) and R8Unorm (8 bit grayscale).
Public methodStatic memberCreateHeightMapSurfaceMesh 
Protected methodOnUpdate
(Overrides ModelNodeOnUpdate)
Protected methodUpdateMesh UpdateMesh method recreates the mesh based on the current object properties. The method should be overriden in the derived class that provides its own mesh generation.
(Overrides ModelNodeUpdateMesh)
Top
See Also