Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@luma.gl/engine

Package Overview
Dependencies
Maintainers
7
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luma.gl/engine

3D Engine Components for luma.gl

  • 9.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80K
decreased by-67.12%
Maintainers
7
Weekly downloads
 
Created

What is @luma.gl/engine?

@luma.gl/engine is a high-performance WebGL2 framework designed for GPU-powered data visualization and graphics rendering. It provides a suite of tools and abstractions to simplify the creation of complex 3D scenes, animations, and visual effects.

What are @luma.gl/engine's main functionalities?

Creating a WebGL Context

This feature allows you to create and manage a WebGL context using the AnimationLoop class. The onInitialize method is used to set up the WebGL context, and the onRender method is used to render each frame.

const {AnimationLoop} = require('@luma.gl/engine');

const animationLoop = new AnimationLoop({
  onInitialize: ({gl}) => {
    // Initialize WebGL context
  },
  onRender: ({gl}) => {
    // Render frame
  }
});

animationLoop.start();

Loading and Displaying a 3D Model

This feature allows you to load and display a 3D model using the Model and Geometry classes. You can define the vertex and fragment shaders, as well as the geometry attributes like positions and normals.

const {Model, Geometry} = require('@luma.gl/engine');

const model = new Model(gl, {
  vs: `...`, // Vertex shader
  fs: `...`, // Fragment shader
  geometry: new Geometry({
    attributes: {
      positions: new Float32Array([...]),
      normals: new Float32Array([...])
    }
  })
});

model.draw();

Handling User Input

This feature allows you to handle user input events such as mouse clicks and keyboard presses using the EventManager class. You can attach event listeners to the canvas and respond to user interactions.

const {EventManager} = require('@luma.gl/engine');

const eventManager = new EventManager(canvas);

eventManager.on('click', (event) => {
  console.log('Canvas clicked', event);
});

Other packages similar to @luma.gl/engine

Keywords

FAQs

Package last updated on 23 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc