pixi.js
    Preparing search index...

    Class PerspectivePlaneGeometryAdvanced

    A PerspectivePlaneGeometry allows you to draw a 2d plane with perspective. Where ever you move the corners the texture will be projected to look like it is in 3d space. Great for mapping a 2D mesh into a 3D scene.

    IMPORTANT: This is not a full 3D mesh, it is a 2D mesh with a perspective projection applied to it :)

    const perspectivePlaneGeometry = new PerspectivePlaneGeometry({
    width: 100,
    height: 100,
    verticesX: 10,
    verticesY: 10,
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attributes: Record<string, Attribute>

    A record of the attributes of the geometry.

    batchMode: BatchMode = 'auto'
    buffers: Buffer[]

    The buffers that the attributes use

    corners: [number, number, number, number, number, number, number, number]

    The corner points of the quad you can modify these directly, if you do make sure to call updateProjection

    height: number

    The height of plane

    indexBuffer: Buffer

    The index buffer of the geometry

    instanceCount: number = 1

    the instance count of the geometry to draw

    topology: Topology

    The topology of the geometry.

    uid: number = ...

    The unique id of the geometry.

    verticesX: number

    The number of vertices on x-axis

    verticesY: number

    The number of vertices on y-axis

    width: number

    The width of plane

    Accessors

    • get bounds(): Bounds

      Returns the bounds of the geometry.

      Returns Bounds

    • get positions(): Float32Array

      The positions of the mesh.

      Returns Float32Array

    • set positions(value: Float32Array): void

      Set the positions of the mesh. When setting the positions, its important that the uvs array is at least as long as the positions array. otherwise the geometry will not be valid.

      Parameters

      Returns void

    • get uvs(): Float32Array

      The UVs of the mesh.

      Returns Float32Array

    • set uvs(value: Float32Array): void

      Set the UVs of the mesh. Its important that the uvs array you set is at least as long as the positions array. otherwise the geometry will not be valid.

      Parameters

      Returns void

    Methods

    • Adds an index buffer to the geometry.

      Parameters

      • indexBuffer: number[] | TypedArray | Buffer

        The index buffer to add. Can be a Buffer, TypedArray, or an array of numbers.

      Returns void

    • destroys the geometry.

      Parameters

      • destroyBuffers: boolean = false

        destroy the buffers associated with this geometry

      Returns void

    • Returns the requested buffer.

      Parameters

      • id: string

        The name of the buffer required.

      Returns Buffer

      • The buffer requested.
    • Used to figure out how many vertices there are in this geometry

      Returns number

      the number of vertices in the geometry

    • Will set the corners of the quad to the given coordinates Calculating the perspective so it looks correct!

      Parameters

      • x0: number

        x coordinate of the first corner

      • y0: number

        y coordinate of the first corner

      • x1: number

        x coordinate of the second corner

      • y1: number

        y coordinate of the second corner

      • x2: number

        x coordinate of the third corner

      • y2: number

        y coordinate of the third corner

      • x3: number

        x coordinate of the fourth corner

      • y3: number

        y coordinate of the fourth corner

      Returns void

    • Update the projection matrix based on the corners

      Returns void