Click or drag to resize

TriangleMeshPrimitiveSet Method (IEnumerableCartesian, IEnumerableCartesian, IEnumerableInt32, TriangleMeshPrimitiveOptionalParameters)

Defines the triangle mesh using an indexed triangle list specified by positions, normals, indices, and optionalParameters. The mesh is rendered in the primitive's ReferenceFrame.

Namespace:  AGI.Foundation.Graphics
Assembly:  AGI.Foundation.Graphics (in AGI.Foundation.Graphics.dll) Version: 19.4.401.0 (19.4.401.0)
Syntax
public void Set(
	IEnumerable<Cartesian> positions,
	IEnumerable<Cartesian> normals,
	IEnumerable<int> indices,
	TriangleMeshPrimitiveOptionalParameters optionalParameters
)

Parameters

positions
Type: System.Collections.GenericIEnumerableCartesian
Positions for the triangle mesh.
normals
Type: System.Collections.GenericIEnumerableCartesian
Normals used for lighting the triangle mesh. There must be one normal for each position in positions.
indices
Type: System.Collections.GenericIEnumerableInt32
Indices into positions and normals. Every 3 indices represent 1 triangle.
optionalParameters
Type: AGI.Foundation.GraphicsTriangleMeshPrimitiveOptionalParameters
Optional parameters corresponding to positions.
Exceptions
ExceptionCondition
ArgumentNullExceptionpositions, normals, or indices is null.
ArgumentException The number of positions and number of normals must be the same.
ArgumentException The number of indices must be divisible by 3.
CouldNotCreateVideoCardResourceException Could not allocate video memory for the mesh.
Remarks

See TriangleMeshPrimitiveOptionalParameters for details on how to define parameters.

If this method is called frequently, it is recommended to construct the primitive with Frequent, which is the default. If this method will be called only once or infrequently, construct the primitive with Infrequent. See the Set Hint topic for more information.

If the primitive's AutomaticallyComputeBoundingSphere property is , the primitive's BoundingSphere is computed based on the input. Otherwise, it is the caller's responsibility to update the primitive's BoundingSphere to a sphere that encompasses the input.

See Also