PolylinePrimitiveSet Method (IEnumerableCartesian) |
Namespace: AGI.Foundation.Graphics
Exception | Condition |
---|---|
ArgumentNullException | positions is null. |
ArgumentException | When the polyline's PolylineType is Lines, positions must have an even number of elements. Every two positions define a line segment. |
CouldNotCreateVideoCardResourceException | Could not allocate video memory for positions. |
This call overwrites the primitive's previous positions and per-position colors. To update a subset of positions, use SetPartial.
If the polyline's PositionInterpolator is not null, positions are interpolated before they are rendered. If the polyline's PolylineType is LineStrip, for each position after the first position, a line segment is rendered that connects the position to the previous position. Otherwise, if Lines is used, a line segment is rendered for every two positions.
Each line segment is rendered with the same color and translucency, which is defined by the primitive's Color and Translucency properties.
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 positions. Otherwise, it is the caller's responsibility to update the primitive's BoundingSphere to a sphere that encompasses all the positions.