luma.gl contains a lot of classes and functions that might make new users wonder where to get started. luma.gl therefore organize classes and functions into groups, as shown in the following table and also in the folder structure of the source code
|src/core||A set of common classes across all 3D graphics applications. They are on a higher abstraction level than the WebGL API. luma.gl's signature |
|src/geometry||This folder contains a collection of geometric primitives extending from the base |
|src/models||Some predefined subclasses of |
|src/io||Node.js and browser file loaders. Also enables using streams in browser.|
|src/packages/events||A very simple browser event handling class used by luma.gl examples|
|src/shadertools||luma.gl's internal shader module system and shader assembler utility|
The heart of luma.gl is the
After creating a context, perhaps with luma.gl's
createGLContext function, you have can start instantiating luma.gl's WebGL2 classes:
core classes, with the signature
Model class, represents a set of objects that is common in most 3D rendering libraries or engines. These objects are at higher abstraction levels than the actual WebGL objects and that can serve as the basic building blocks for most 3D applications.
Model- A renderable object with program, attributes, uniforms and other state required for rendering 3D objects on the screen
Geometry- Holds attributes and drawType for a primitive geometric object
AnimationLoop- A simple animation loop that connects with browser's animation mechanism
drawMode prop to indicate how to interpret those vertices and normals as actual geometries.
There are several basic geometry classes predefined in luma.gl:
SphereGeometry. They are all subclasses of the
Users are encouraged to write their own geometries and models and luma.gl could include them in its future releases.