TriangleMeshPrimitiveSet Method (IEnumerableCartesian, IEnumerableCartesian, IEnumerableInt32, TriangleMeshPrimitiveOptionalParameters) |
Namespace: AGI.Foundation.Graphics
public void Set( IEnumerable<Cartesian> positions, IEnumerable<Cartesian> normals, IEnumerable<int> indices, TriangleMeshPrimitiveOptionalParameters optionalParameters )
Exception | Condition |
---|---|
ArgumentNullException | positions, 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. |
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.