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

@deck.gl/mesh-layers

Package Overview
Dependencies
Maintainers
9
Versions
402
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deck.gl/mesh-layers

deck.gl layers that loads 3D meshes or scene graphs

  • 7.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
138K
decreased by-23.78%
Maintainers
9
Weekly downloads
 
Created

What is @deck.gl/mesh-layers?

@deck.gl/mesh-layers is a part of the Deck.gl framework, which is a WebGL-powered framework for visual exploratory data analysis of large datasets. The @deck.gl/mesh-layers package specifically provides layers for rendering 3D meshes, which can be used for visualizing complex 3D geometries, models, and scenes.

What are @deck.gl/mesh-layers's main functionalities?

Simple Mesh Layer

This code demonstrates how to create a SimpleMeshLayer using the @deck.gl/mesh-layers package. It loads a 3D mesh from an OBJ file and renders it with a specified color.

const {Deck} = require('@deck.gl/core');
const {SimpleMeshLayer} = require('@deck.gl/mesh-layers');
const {OBJLoader} = require('@loaders.gl/obj');

const mesh = new OBJLoader().parse(objFileContent);

const layer = new SimpleMeshLayer({
  id: 'simple-mesh-layer',
  data: [{position: [0, 0, 0]}],
  mesh,
  getPosition: d => d.position,
  getColor: [255, 0, 0]
});

const deck = new Deck({
  initialViewState: {
    longitude: -122.45,
    latitude: 37.8,
    zoom: 14
  },
  controller: true,
  layers: [layer]
});

Scenegraph Layer

This code demonstrates how to create a ScenegraphLayer using the @deck.gl/mesh-layers package. It loads a 3D scenegraph from a GLTF file and renders it with specified position, orientation, and scale.

const {Deck} = require('@deck.gl/core');
const {ScenegraphLayer} = require('@deck.gl/mesh-layers');

const layer = new ScenegraphLayer({
  id: 'scenegraph-layer',
  data: [{position: [0, 0, 0]}],
  scenegraph: 'path/to/scenegraph.gltf',
  getPosition: d => d.position,
  getOrientation: [0, 0, 90],
  getScale: [1, 1, 1]
});

const deck = new Deck({
  initialViewState: {
    longitude: -122.45,
    latitude: 37.8,
    zoom: 14
  },
  controller: true,
  layers: [layer]
});

Other packages similar to @deck.gl/mesh-layers

Keywords

FAQs

Package last updated on 05 Jun 2019

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