@pixi/3d
    Preparing search index...

    Interface ConeGeometryOptions

    Options for ConeGeometry

    const options: Partial<ConeGeometryOptions> = { radius: 0.5, height: 1 };
    const cone = new ConeGeometry(options);
    interface ConeGeometryOptions {
        attributes?: Record<string, Attribute>;
        bounds3D?: Box;
        colors?:
            | Float32Array<ArrayBufferLike>
            | Uint8Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Attribute;
        colors1?:
            | Float32Array<ArrayBufferLike>
            | Uint8Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Attribute;
        dynamic?: boolean;
        height: number;
        heightSegments: number;
        indexCount?: number;
        indices?:
            | Uint16Array<ArrayBufferLike>
            | Uint32Array<ArrayBufferLike>
            | Buffer;
        interleave?: boolean;
        joints?:
            | Uint8Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Attribute;
        morphTargets?: {
            normals?: Float32Array<ArrayBufferLike>;
            positions: Float32Array;
        }[];
        normals?: Float32Array<ArrayBufferLike>
        | Attribute;
        openEnded: boolean;
        positions?: Float32Array<ArrayBufferLike> | Attribute;
        quantizeNormals?: boolean;
        quantizeTangents?: boolean;
        radialSegments: number;
        radius: number;
        shrinkBuffersToFit?: boolean;
        tangents?: Float32Array<ArrayBufferLike> | Attribute;
        topology?: Topology;
        uvs?: Float32Array<ArrayBufferLike> | Attribute;
        weights?:
            | Float32Array<ArrayBufferLike>
            | Uint8Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Attribute;
    }

    Hierarchy (View Summary)

    Index
    attributes?: Record<string, Attribute>

    A prebuilt attribute map, keyed by shader attribute name

    Use it to supply your own buffers or interleaved layout. The names the other options fill are aPosition, aUV, aNormal, aTangent, aJoints, aWeights, aColor and aColor1.

    With a map, the per-attribute options build nothing, so pass bounds3D too: a geometry with empty bounds is never culled, and picking never hits it.

    const geometry = new Geometry3D({
    attributes: { aPosition: { buffer, format: 'float32x3', stride: 12, offset: 0 } },
    bounds3D: new Box(new Vector3(-1, -1, -1), new Vector3(1, 1, 1)),
    });
    bounds3D?: Box

    The geometry's local bounding box; computed from float positions when omitted

    Pass it when you already know the box, to skip scanning the positions. Integer positions throw without it, and need it in the values their format reads as: within -1 to 1 for snorm16x4, the stored integers for sint16x4.

    const geometry = new Geometry3D({
    positions,
    bounds3D: new Box(new Vector3(-1, -1, -1), new Vector3(1, 1, 1)),
    });
    colors?:
        | Float32Array<ArrayBufferLike>
        | Uint8Array<ArrayBufferLike>
        | Uint16Array<ArrayBufferLike>
        | Attribute

    Vertex colours, four components per vertex (RGBA)

    A Float32Array is used as floats; an integer array is read as normalized, 0 to 1. Widen RGB colours to RGBA with an opaque alpha first. BaseMaterial3D#vertexColors decides whether they tint.

    const red = new Uint8Array([255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255]);
    const geometry = new Geometry3D({ positions, colors: red });
    colors1?:
        | Float32Array<ArrayBufferLike>
        | Uint8Array<ArrayBufferLike>
        | Uint16Array<ArrayBufferLike>
        | Attribute

    A second set of vertex colours, read as aColor1, with the same rules as colors

    Materials never tint with it; only a custom shader bit that declares aColor1 reads it, which makes it the place for data that isn't really a colour, such as a wind mask.

    const geometry = new Geometry3D({ positions, colors1: windMask });
    
    dynamic?: boolean

    Draw the geometry from its own buffers, so later writes to them reach the screen

    Set it when you rewrite the vertices every frame, as a trail or a particle system does. A dynamic geometry is never frustum-culled. Fixed at construction.

    false
    
    const trail = new Geometry3D({ positions: new Float32Array(64 * 3), dynamic: true });

    app.ticker.add(() => {
    writeTrailPoints(trail.positions);
    trail.attributes.aPosition.buffer.update();
    });
    height: number

    The total height of the cone along the Y axis

    2
    
    const spike = new ConeGeometry({ radius: 0.2, height: 3 });
    
    heightSegments: number

    The number of segments along the height

    Floored, and clamped to a minimum of 1.

    1
    
    const bendable = new ConeGeometry({ heightSegments: 8 });
    
    indexCount?: number

    How many indices to draw, when that is fewer than the index buffer holds

    0 draws the whole buffer. Only a dynamic geometry honours it; any other draws its whole index buffer. Use it to draw a prefix of an index buffer several geometries share.

    0
    
    const firstTen = new Geometry3D({ positions, indices: sharedQuadIndices, indexCount: 10 * 6, dynamic: true });
    
    indices?: Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | Buffer

    Vertex indices, three per triangle for the default triangle-list topology

    Left out, the vertices are drawn in order. A Uint16Array of odd length is copied into a Uint32Array. A Buffer is used as it is, so several geometries can share one.

    const quad = new Geometry3D({
    positions: new Float32Array([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0]),
    indices: new Uint16Array([0, 1, 2, 0, 2, 3]),
    });
    interleave?: boolean

    Whether to pack the attributes into one interleaved buffer

    Only a dynamic geometry draws from its own buffers; for any other, this changes how its own data is laid out, not how it draws. Per-triangle picking, a hitVolume of 'geometry', never hits an interleaved geometry.

    false
    
    const trail = new Geometry3D({ positions, colors, interleave: true, dynamic: true });
    
    joints?: Uint8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Attribute

    Four bone indices per vertex, for skinning

    const geometry = new Geometry3D({ positions, joints: new Uint8Array(vertexCount * 4), weights });
    
    morphTargets?: {
        normals?: Float32Array<ArrayBufferLike>;
        positions: Float32Array;
    }[]

    Morph targets (blend shapes), each a set of per-vertex offsets from positions

    A Mesh3D drawing the geometry blends the targets by its Mesh3D#weights. Normal offsets are used only when every target has them. A geometry morphs in one renderer only: once a second renderer draws it, even a new Application made after the first is destroyed, it draws unmorphed from then on and warns once.

    Culling allows for weights from 0 to 1. For weights outside that range, pass a larger bounds3D.

    Type Declaration

    • Optionalnormals?: Float32Array<ArrayBufferLike>

      Offsets from the base normals, three floats per vertex

      const geometry = new Geometry3D({
      positions,
      normals,
      morphTargets: [{ positions: bulgeOffsets, normals: bulgeNormalOffsets }],
      });
    • positions: Float32Array

      Offsets from the base positions, three floats per vertex

      const raise = new Float32Array(vertexCount * 3);
      for (let i = 1; i < raise.length; i += 3) raise[i] = 0.5;
      const geometry = new Geometry3D({ positions, morphTargets: [{ positions: raise }] });
    const geometry = new Geometry3D({ positions, morphTargets: [{ positions: smileOffsets }] });
    const face = new Mesh3D({ geometry, material, weights: new Float32Array([0.5]) });
    normals?: Float32Array<ArrayBufferLike> | Attribute

    Vertex normals, three floats per vertex

    Without them the geometry shades as if every normal were (0, 0, 1), which suits unlit billboards and ribbons. quantizeNormals decides how they are stored.

    const geometry = new Geometry3D({ positions, normals });
    
    openEnded: boolean

    When true, the base cap is skipped and only the side surface is generated

    false
    
    const funnel = new ConeGeometry({ openEnded: true });
    
    positions?: Float32Array<ArrayBufferLike> | Attribute

    Vertex positions, three floats per vertex

    Integer positions come in as an Attribute, since only its format says how to read them: snorm as -1 to 1, unorm as 0 to 1, and sint or uint as the stored integers. An integer typed array throws. Pad 8- and 16-bit xyz to four components per vertex, and pass bounds3D.

    const triangle = new Geometry3D({ positions: new Float32Array([0, 1, 0, -1, -1, 0, 1, -1, 0]) });
    
    quantizeNormals?: boolean

    Whether to store Float32Array normals as 16-bit signed integers

    They then take 8 bytes per vertex instead of 12, with negligible visual difference. Read them back as floats with getAttributeData.

    true
    
    const geometry = new Geometry3D({ positions, normals, quantizeNormals: false });
    
    quantizeTangents?: boolean

    Whether to store Float32Array tangents as 16-bit signed integers

    They then take 8 bytes per vertex instead of 16, with negligible visual difference. Read them back as floats with getAttributeData.

    true
    
    const geometry = new Geometry3D({ positions, normals, tangents, quantizeTangents: false });
    
    radialSegments: number

    The number of segments around the circumference

    Floored, and clamped to a minimum of 3.

    32
    
    const pyramid = new ConeGeometry({ radialSegments: 4 });
    
    radius: number

    The radius of the base ring (at -height/2)

    1
    
    const wide = new ConeGeometry({ radius: 2 });
    
    shrinkBuffersToFit?: boolean

    Whether the geometry's own GPU buffers may shrink to fit their data when it gets smaller

    false
    
    const geometry = new Geometry3D({ positions, shrinkBuffersToFit: true });
    
    tangents?: Float32Array<ArrayBufferLike> | Attribute

    Vertex tangents, four floats per vertex: the tangent direction, then 1 or -1 for which way the bitangent points

    Normal maps use them when present and otherwise derive a tangent frame per pixel. quantizeTangents decides how they are stored.

    const geometry = new Geometry3D({ positions, normals, uvs, tangents });
    
    topology?: Topology

    Primitive topology used when drawing the mesh

    'triangle-list'
    
    const wireframe = new Geometry3D({ positions, indices: edgeIndices, topology: 'line-list' });
    
    uvs?: Float32Array<ArrayBufferLike> | Attribute

    Texture coordinates, two floats per vertex

    Integer coordinates come in as an Attribute, read as integer positions are: unorm16x2 as 0 to 1, uint16x2 as the stored integers, which the material's BaseMaterial3D#uvTransform has to scale back down.

    const quad = new Geometry3D({ positions, uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]) });
    
    weights?:
        | Float32Array<ArrayBufferLike>
        | Uint8Array<ArrayBufferLike>
        | Uint16Array<ArrayBufferLike>
        | Attribute

    Four bone weights per vertex, matching joints

    A Float32Array is used as floats; an integer array is read as normalized, 0 to 1.

    const geometry = new Geometry3D({ positions, joints, weights: new Float32Array(vertexCount * 4) });