Class TriangularPrismProceduralModel
- Namespace
- Stride.CommunityToolkit.Rendering.ProceduralModels
- Assembly
- Stride.CommunityToolkit.dll
Procedural model that generates a triangular prism.
public class TriangularPrismProceduralModel : PrimitiveProceduralModelBase, IProceduralModel
- Inheritance
-
TriangularPrismProceduralModel
- Implements
- Inherited Members
Remarks
The triangular cross-section lies in the X/Y plane and the prism extends along the Z axis (depth). X specifies the base width of the triangle (across -X..+X), Y specifies the triangle height (across -Y..+Y), and Z specifies the prism depth. The triangle is centered around Y = 0 with the apex at Y = +Y/2 and the base at Y = -Y/2. Texture coordinates are generated per-face using a simple 0..1 quad mapping and scaled by UvScale.
Properties
Size
Overall extent of the prism.
public Vector3 Size { get; set; }
Property Value
Remarks
X: Base width of the triangle (across -X..+X).
Y: Height of the triangle (apex-to-base, centered around 0).
Z: Depth of the prism (along the Z axis).
Methods
CreatePrimitiveMeshData()
protected override GeometricMeshData<VertexPositionNormalTexture> CreatePrimitiveMeshData()
Returns
- GeometricMeshData<VertexPositionNormalTexture>
The generated geometric mesh data.
New(Vector3, float, float, bool)
Creates a triangular prism mesh.
public static GeometricMeshData<VertexPositionNormalTexture> New(Vector3 size, float uScale = 1, float vScale = 1, bool toLeftHanded = false)
Parameters
sizeVector3Overall extent where X = base width, Y = triangle height, Z = depth.
uScalefloatOptional U texture tiling scale.
vScalefloatOptional V texture tiling scale.
toLeftHandedboolIf true, marks the mesh data as left-handed (indices will be interpreted accordingly).
Returns
- GeometricMeshData<VertexPositionNormalTexture>
Generated mesh data for a triangular prism (18 vertices, 24 indices).