H3DU.BufferedMesh
H3DU.BufferedMesh(mesh, context)
Deprecated: This class is likely to become a private class. Use the H3DU.MeshBuffer class instead, which is not coupled to WebGL contexts.
A geometric mesh in the form of buffer objects.
Parameters
mesh
(Type: H3DU.Mesh | H3DU.MeshBuffer)
A geometric mesh object. Cannot be null.context
(Type: WebGLRenderingContext | WebGL2RenderingContext | Object)
A WebGL context to create a buffer from, or an object, such as H3DU.Scene3D, that implements a no-argumentgetContext
method that returns a WebGL context. (Note that this constructor uses a WebGL context rather than a shader program because buffer objects are not specific to shader programs.)
Methods
- dispose
Deletes the vertex and index buffers associated with this object. - draw
Deprecated: Yes - getContext
Deprecated: Yes - primitiveCount
Gets the number of primitives (triangles, lines, and points) composed by all shapes in this mesh. - vertexCount
Gets the number of vertices composed by all shapes in this mesh.
H3DU.BufferedMesh#dispose()
Deletes the vertex and index buffers associated with this object.
Return Value
This method doesn't return a value. (Type: void)
H3DU.BufferedMesh#draw(program)
Deprecated: Yes
Binds the buffers in this object to attributes according to their data format, and draws the elements in this mesh according to the data in its buffers.
Parameters
program
(Type: H3DU.ShaderProgram)
A shader program object to get the IDs from for attributes named "position", "normal", "colorAttr", and "uv", and the "useColorAttr" uniform.
Return Value
This method doesn't return a value. (Type: void)
H3DU.BufferedMesh#getContext()
Deprecated: Yes
Returns the WebGL context associated with this object.
Return Value
Return value. (Type: WebGLRenderingContext | WebGL2RenderingContext)
H3DU.BufferedMesh#primitiveCount()
Gets the number of primitives (triangles, lines, and points) composed by all shapes in this mesh.
Return Value
Return value. (Type: number)
H3DU.BufferedMesh#vertexCount()
Gets the number of vertices composed by all shapes in this mesh.
Return Value
Return value. (Type: number)