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

gl-tetrahedron

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-tetrahedron

a simple tetrahedron utility for stackgl

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gl-tetrahedron

This has been forked from mattdesl's awesome work. I stand on his shoulders.

unstable

Creates an indexed tetrahedron that you can draw.

The side lengths of the tetrahedron are 1 by default. The "top" vertex lies on the positive z axis while the "bottom" of the tetrahedron is parallel to the xy plane. The tetrahedron is centered at the origin. This is intended to make it easy to use in utilities where you need some kind of direction indicator. For example, I use it in my gl-vector-field (http://github.com/coballast/gl-vector-field) repo as a default direction mesh. I apply non uniform scaling in the shader to indicate magnitude.

Usage

var gl = require('webgl-context')

var tetra = require('gl-tetrahedron')(gl)
tetra.draw( myShader )

The passed shader is expected to have position and normal attributes.

functions

var tetra = createTetra(gl)

Creates a new tetrahedron with position and normal buffers.

tetra.draw([shader])

Draws the tetrahedron with a gl-shader.

If a shader is not passed, it's assumed that you've already bound a shader.

tetra.dispose()

Disposes the tetrahedron.

members

tetra.mesh

The gl-mesh Object backing this tetrahedron.

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Package last updated on 12 May 2015

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