Table of Contents

Class Procedural3DModelBuilder

Namespace
Stride.CommunityToolkit.Rendering.ProceduralModels
Assembly
Stride.CommunityToolkit.dll

A helper class for generating 3D procedural models based on a specified primitive model type and size.

public static class Procedural3DModelBuilder
Inheritance
Procedural3DModelBuilder

Methods

Build(PrimitiveModelType, Vector3?)

Generates a 3D procedural model based on the specified primitive model type and size.

public static PrimitiveProceduralModelBase Build(PrimitiveModelType type, Vector3? size = null)

Parameters

type PrimitiveModelType

The type of 3D primitive model to create (e.g., Cube, Sphere, Capsule).

size Vector3?

The size parameters for the model as a Vector3, where X, Y, and Z represent the dimensions. If null, default dimensions for the model type will be used.

Returns

PrimitiveProceduralModelBase

A PrimitiveProceduralModelBase object representing the generated 3D model. The dimensions of the model will be determined by the provided size or default dimensions if size is null.

Remarks

This method allows for the creation of different types of primitive 3D models (such as Cube, Sphere, etc.) with the specified size. If no size is provided, default dimensions for each model type will be used.

Exceptions

InvalidOperationException

Thrown when an unsupported type is specified.