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

gl-select

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-select

Point picking and selection routines for glsl

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

gl-select

Helper module for point picking rendering passes

Install

npm install gl-select

API

var createSelectBuffer = require("gl-select")

Constructor

var select = createSelectBuffer(gl, shape)

Creates a select buffer with the given shape

Methods

select.begin(x, y, radius)

Begins a selection pass for finding the closest point in the buffer to x,y

  • x and y are the coordinates of the query point starting from the top-left of the screen
  • radius is the radius in pixels to search
select.end()

Finishes the selection pass.

Returns An object whose properties encode the result of the closest point to the query point within radius, or null if no points are found. The properties of this object are:

  • coord A length 2 array representing the coordinates of the closest pixel
  • id The 8 bit identifier of the closest point
  • value a 3 component vector storing the value of the selection
  • distance The distance of the closest point to the selection point
select.dispose()

Destroys the selection buffer and releases all associated resources

Properties

select.shape

Updates or retrieves the shape of the selection buffer.

(c) 2014 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 26 Sep 2014

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