Header menu logo Mibo

Primitive3D Module

Pre-generated primitive meshes for 3D rendering. The MonoGame analog of raylib's GenMeshCube/GenMeshSphere/etc. — there is no native generator, so these are built once from VertexPositionNormalTexture arrays.

Unlike the raylib canonical (which exposes module-level let values), the MonoGame port needs a GraphicsDevice to construct the GPU buffers, so call Primitive3D.create gd once at startup and hold the result. Each mesh is unit-sized (cube 1³, sphere r=1, etc.); scale via the draw transform.

Types

Type Description

PrimitiveSet

A bundle of the six unit primitives. Build once and hold.

Functions and values

Function or value Description

create gd

Full Usage: create gd

Parameters:
    gd : GraphicsDevice - The graphics device used to allocate the vertex/index buffers.

Returns: PrimitiveSet A PrimitiveSet holding the six meshes.

Creates all six unit primitives, uploading their GPU buffers once.

gd : GraphicsDevice

The graphics device used to allocate the vertex/index buffers.

Returns: PrimitiveSet

A PrimitiveSet holding the six meshes.

Type something to start searching.