Draws axis spikes compatible with gl-axes. This can be useful to illustrate selections or specific points in a point cloud
var shell = clearColor: 0000 tickRate: 5var 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 spikesshellshell
npm install gl-spikes
Creates a new spike object.
glis a WebGL context
optionsis a list of optional parameters which are passed along
Draws the axis spikes using the given camera coordinates.
camera.modelis the model matrix for the camera
camera.viewis the view matrix
camera.projectionis the projection matrix
Updates the parameters of the axes spikes.
options is an object with the following properties:
positionthe position of the spike ball in data coordinates
boundsthe bounds of the axes object
colorsan array of 3 length 4 arrays encoding the RGBA colors for the spikes along the x/y/z directions
enabledan array of 3 flags which if set turns on or off the spikes
drawSidesan array of 3 flag which if set turns on or off the projected spikes in each data plane
lineWidthan array of 3 numbers giving the thickness of the spikes for each axis
Destroys the spike object and releases all associated resources.
(c) 2014 Mikola Lysenko. MIT License