NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import MeshBuffer from 'ngl/src/buffer/mesh-buffer.js'
public class | source

MeshBuffer

Extends:

Buffer → MeshBuffer

Mesh buffer. Draws a triangle mesh.

Example:

var meshBuffer = new MeshBuffer( {
    position: new Float32Array(
        [ 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1 ]
    ),
    color: new Float32Array(
        [ 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 ]
    )
} );

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get
public get

Inherited Summary

From class Buffer
public get
public get
public get abstract
public get
public set
public get
public get
public get
public get
public get abstract
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
private
public
public
public

Free buffer resources

public
public
public
public
public
public
public
public
public
public
public
public
public
public

Sets buffer attributes

public
public

Set buffer parameters

public
public
public

Set buffer visibility

public
public
public
private

Public Constructors

public constructor(data: Object, params: BufferParameters) source

Override:

Buffer#constructor

Params:

NameTypeAttributeDescription
data Object

attribute object

data.position Float32Array

positions

data.color Float32Array

colors

data.index Float32Array
  • optional

triangle indices

data.normal Float32Array
  • optional

radii

params BufferParameters

parameter object

Public Members

public get fragmentShader source

Override:

Buffer#fragmentShader

public get vertexShader source

Override:

Buffer#vertexShader