Click or drag to resize
AB4D logo

SimpleMeshTArrayStride Property

Gets or sets an integer that specifies how many VertexBufferArray elements define one Vertex. Default value is 1. See remarks for more info.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public int ArrayStride { get; set; }

Property Value

Int32
Remarks

ArrayStride gets or sets an integer that specifies how many VertexBufferArray elements define one Vertex.

When SimpleMesh is created with standard vertex buffer structs like PositionNormalTexture, then the ArrayStride should be set to 1 because on PositionNormalTexture element (one element in array) defines all the data needed to describe one Vertex.

When SimpleMesh is created with basic types like float or byte, then more then one array element is needed to define one Vertex. For example if SimpleMesh is defined as SimpleMesh<float> (with float values) and one Vertex data contains position, normal and texture, then the ArrayStride should be 3 + 3 + 2 = 8 (8 float values represent one Vertex). When using byte, the ArrayStride should be set to (3 + 3 + 2) * 4 = 32 (32 bytes for one Vertex; 1 float = 4 bytes)

This value must be changed before the SimpleMesh is initialized. If the value is changed after that, the RecreateMesh(Boolean, Boolean, Boolean) must be called.

Default value is 1.

See Also