gl-spikes3d
Draws axis spikes compatible with gl-axes3d. This can be useful to illustrate selections or specific points in a point cloud
Example
var shell = clearColor: 0000 tickRate: 5 var camera = shellvar mat4 = mat4var createAxes = var createSpikes = //Bounds on function to plotvar bounds = -1-1-1 111 //camera.lookAt([-15,20,-15], [0,0,0], [0, 1, 0])camera //State variablesvar axes spikes shell shell
Install
npm install gl-spikes
API
var spikes = require('gl-spikes')(gl, options)
Creates a new spike object.
gl
is a WebGL contextoptions
is a list of optional parameters which are passed along
Methods
spikes.draw(camera)
Draws the axis spikes using the given camera coordinates.
camera.model
is the model matrix for the cameracamera.view
is the view matrixcamera.projection
is the projection matrix
spikes.update(options)
Updates the parameters of the axes spikes. options
is an object with the following properties:
position
the position of the spike ball in data coordinatesbounds
the bounds of the axes objectcolors
an array of 3 length 4 arrays encoding the RGBA colors for the spikes along the x/y/z directionsenabled
an array of 3 flags which if set turns on or off the spikesdrawSides
an array of 3 flag which if set turns on or off the projected spikes in each data planelineWidth
an array of 3 numbers giving the thickness of the spikes for each axis
spikes.dispose()
Destroys the spike object and releases all associated resources.
Credits
(c) 2014 Mikola Lysenko. MIT License