Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
box-geometry
Advanced tools
Simple cube geometry mesh generator for gl-vao
Creates a Vertex Array Object for a 1x1x1 cube from (-0.5,-0.5,-0.5) to (+0.5.+0.5,+0.5). Also optionally sets UV coordinates for texturing and applies matrix transformations.
For an example, run npm start
or try the live demo.
Click and drag to rotate the cube (uses game-shell-orbit-camera).
See the avatar module for more advanced usage.
Usage:
var createBoxMesh = require('box-geometry');
var mesh = createBoxMesh(gl,
{
// mesh options
}[, globalOpts]);
will create one cube. Alternatively you can pass an array of objects to create multiple cubes in one mesh. Supported mesh options:
uv
: Array to set UV texture coordinates, for each of the six faces.
For each face: the starting U and V coordinates, the width and height (actually
offsets, may be negative to reverse),
and a rotation value (0 to 3, determines where the starting coordinate
corresponds to one of the four face corner vertices). Example using the same
whole texture everywhere:
//x y w h r
0, 0, 1, 1, 0, // back
0, 0, 1, 1, 0, // front
0, 0, 1, 1, 0, // top
0, 0, 1, 1, 0, // bottom
0, 0, 1, 1, 0, // left
0, 0, 1, 1, 0 // right
matrix
: 4x4 transformation matrix, applied to all vertices before adding to mesh
(create using gl-matrix).
Global options:
uDiv
, vDiv
: Divisors used to scale the UV coordinates in the uv
array above.
By default these are 1, but you can set them to a higher value to more conveniently
represent UV coordinates in your application (for example, set to 64 then pass
32 instead of 32/64=0.5, or 1 instead of 1/64=0.015625, etc.).
setWindex
: If true, the w
coordinate of each vertex will be set to the cube's
index. Useful if there are multiple cubes and you want to handle them differently
in the shader using this coordinate. Otherwise it set to 1.0.
BoxGeometry
class (formerly CubeGeometry
)MIT
FAQs
cube geometry mesh generator for gl-vao
The npm package box-geometry receives a total of 279 weekly downloads. As such, box-geometry popularity was classified as not popular.
We found that box-geometry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.