Skip to content

Containers of meshes loaded from 3D model formats

Notifications You must be signed in to change notification settings

simulation-tree/models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Models

Definitions for 3D models and the meshes that they contain.

Importing models

When models are imported, they will contain a list of meshes, each with their own data:

using World world = new();
Model model = new(world, "*/model.fbx");
while (!model.Is())
{
    world.Submit(new DataUpdate()); //to load the bytes
    world.Submit(new ModelUpdate()); //load import the model from the bytes
    world.Poll();
}

//after the model is loaded
uint meshCount = model.MeshCount;
for (uint i = 0; i < meshCount; i++)
{
    Mesh mesh = model[i];
    ReadOnlySpan<Vector3> vertices = mesh.Positions.AsSpan();
    ReadOnlySpan<uint> indices = mesh.Indices.AsSpan();
}

About

Containers of meshes loaded from 3D model formats

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages