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

@math.gl/culling

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@math.gl/culling

Culling Functionality for 3D Classes

  • 3.3.0-alpha.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
173K
increased by3.2%
Maintainers
4
Weekly downloads
 
Created

What is @math.gl/culling?

@math.gl/culling is a JavaScript library that provides various culling algorithms and utilities for 3D graphics applications. It is part of the math.gl suite of libraries, which are designed to handle mathematical computations for graphics and geospatial applications. The culling package specifically focuses on determining the visibility of objects within a scene, which is crucial for optimizing rendering performance.

What are @math.gl/culling's main functionalities?

Frustum Culling

Frustum culling is used to determine whether objects are within the camera's view frustum. This helps in optimizing rendering by not drawing objects that are outside the view.

const { PerspectiveFrustum } = require('@math.gl/culling');
const frustum = new PerspectiveFrustum({
  fov: Math.PI / 3,
  aspectRatio: 1.0,
  near: 1.0,
  far: 100.0
});
const boundingVolume = { /* bounding volume data */ };
const isVisible = frustum.intersectsBoundingVolume(boundingVolume);
console.log(isVisible);

Bounding Volume Hierarchy (BVH)

Bounding Volume Hierarchy (BVH) is a tree structure on a set of geometric objects. BVH is used to accelerate the process of ray tracing and collision detection.

const { BoundingVolumeHierarchy } = require('@math.gl/culling');
const bvh = new BoundingVolumeHierarchy({
  /* BVH construction data */
});
const ray = { /* ray data */ };
const hit = bvh.intersectRay(ray);
console.log(hit);

Occlusion Culling

Occlusion culling is used to determine if an object is hidden behind other objects. This helps in optimizing rendering by not drawing objects that are not visible to the camera.

const { OcclusionCulling } = require('@math.gl/culling');
const occlusionCulling = new OcclusionCulling();
occlusionCulling.addOccluder({ /* occluder data */ });
const isOccluded = occlusionCulling.isOccluded({ /* bounding volume data */ });
console.log(isOccluded);

Other packages similar to @math.gl/culling

Keywords

FAQs

Package last updated on 25 Aug 2020

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