Simple3D
Search Results for

    Show / Hide Table of Contents

    Class Mesh

    Immutable indexed triangle geometry. Counterclockwise vertices face outward; both sides render by default.

    Inheritance
    object
    Mesh
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Simple3D.Core
    Assembly: Simple3D.Core.dll
    Syntax
    public sealed class Mesh

    Constructors

    | Edit this page View Source

    Mesh(IEnumerable<Vector3>, IEnumerable<int>)

    Copies and validates finite vertices, index ranges and nondegenerate triangles. Empty meshes are allowed. Triangles whose single-precision area overflows or underflows are rejected.

    Declaration
    public Mesh(IEnumerable<Vector3> vertices, IEnumerable<int> indices)
    Parameters
    Type Name Description
    IEnumerable<Vector3> vertices
    IEnumerable<int> indices
    | Edit this page View Source

    Mesh(IEnumerable<Vector3>, IEnumerable<int>, IEnumerable<Vector2>?, IEnumerable<Vector3>?, IEnumerable<uint>?)

    Copies geometry and optional per-vertex attributes. Supplied attribute counts must match the vertex count.

    Declaration
    public Mesh(IEnumerable<Vector3> vertices, IEnumerable<int> indices, IEnumerable<Vector2>? textureCoordinates = null, IEnumerable<Vector3>? normals = null, IEnumerable<uint>? colors = null)
    Parameters
    Type Name Description
    IEnumerable<Vector3> vertices
    IEnumerable<int> indices
    IEnumerable<Vector2> textureCoordinates
    IEnumerable<Vector3> normals
    IEnumerable<uint> colors

    Fields

    | Edit this page View Source

    MaximumElements

    Maximum number of vertices or triangles accepted in one mesh.

    Declaration
    public const int MaximumElements = 1000000
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    Colors

    Optional opaque ARGB vertex colors, multiplied by material color and texture.

    Declaration
    public IReadOnlyList<uint>? Colors { get; }
    Property Value
    Type Description
    IReadOnlyList<uint>
    | Edit this page View Source

    Indices

    Copied vertex indices, three per triangle.

    Declaration
    public IReadOnlyList<int> Indices { get; }
    Property Value
    Type Description
    IReadOnlyList<int>
    | Edit this page View Source

    Normals

    Optional normalized local-space normals, one per vertex. Presence enables Gouraud smooth lighting.

    Declaration
    public IReadOnlyList<Vector3>? Normals { get; }
    Property Value
    Type Description
    IReadOnlyList<Vector3>
    | Edit this page View Source

    TextureCoordinates

    Optional UV coordinates, one per vertex; origin is bottom-left.

    Declaration
    public IReadOnlyList<Vector2>? TextureCoordinates { get; }
    Property Value
    Type Description
    IReadOnlyList<Vector2>
    | Edit this page View Source

    TriangleCount

    Number of triangles.

    Declaration
    public int TriangleCount { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Vertices

    Copied vertices in local coordinates.

    Declaration
    public IReadOnlyList<Vector3> Vertices { get; }
    Property Value
    Type Description
    IReadOnlyList<Vector3>

    Methods

    | Edit this page View Source

    WithCalculatedNormals()

    Returns a copy with area-weighted normals averaged at shared indices. Split vertices retain hard edges. Unused or cancelling vertices use +Z.

    Declaration
    public Mesh WithCalculatedNormals()
    Returns
    Type Description
    Mesh
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX