Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@deck.gl/mesh-layers
Advanced tools
@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.
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]
});
Three.js is a popular JavaScript library for creating 3D graphics in the browser. It provides a comprehensive set of features for rendering 3D models, scenes, and animations. Compared to @deck.gl/mesh-layers, Three.js offers more low-level control and flexibility but requires more boilerplate code to set up and manage scenes.
Babylon.js is another powerful JavaScript framework for building 3D games and visualizations. It offers a rich set of features for rendering 3D content, including support for WebXR, physics, and advanced materials. Babylon.js is more feature-rich and game-oriented compared to @deck.gl/mesh-layers, which is more focused on data visualization.
A-Frame is a web framework for building virtual reality (VR) experiences. It is built on top of Three.js and provides an easy-to-use, declarative HTML-like syntax for creating 3D and VR content. A-Frame is more focused on VR and AR experiences, whereas @deck.gl/mesh-layers is geared towards data visualization and rendering 3D meshes.
deck.gl [v7.2.0-alpha.1] - June 21, 2019
FAQs
deck.gl layers that loads 3D meshes or scene graphs
The npm package @deck.gl/mesh-layers receives a total of 107,918 weekly downloads. As such, @deck.gl/mesh-layers popularity was classified as popular.
We found that @deck.gl/mesh-layers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.