Constructor
new L3D.GLDraw()
Methods
createSurfaceShader(surfaceFunction, uniforms, macros)
A helper to create shaders when you only want to specify some basic shading.
Parameters
surfaceFunction |
String | |
uniforms |
* | |
macros |
* |
drawCylinder(radius, height, segments)
Draws a cylinder
Parameters
radius |
* | |
height |
* | |
segments |
* |
drawLines(lines, colors, strip, loop)
Draw lines given a set of points.
Parameters
lines |
* | |
colors |
* | |
strip |
* | |
loop |
* |
drawMesh(mesh, primitive, shader, indices, rangeStart, rangeLength)
Draw the given mesh, applying the stack transformations
Parameters
mesh |
* | |
primitive |
* | |
shader |
* | |
indices |
* | |
rangeStart |
* | |
rangeLength |
* |
drawPoints(points, colors, shader)
Draw points given a set of positions
Parameters
points |
* | |
colors |
* | |
shader |
* |
drawPointsWithSize(points, colors, sizes, texture, shader)
Draw points with color, size, and texture
Parameters
points |
* | |
colors |
* | |
sizes |
* | |
texture |
* | |
shader |
* |
drawRoundPoints(points, colors, shader)
Draw round points given a set of positions
Parameters
points |
* | |
colors |
* | |
shader |
* |
reset(resetMemory)
Reset the stack
Parameters
resetMemory |
bool |
setAlpha(alpha)
Sets the alpha used to draw primitives
Parameters
alpha |
number |
setColor(color)
Set the color used to draw primitives
Parameters
color |
Array |
setLineWidth(v)
Set the line width
Parameters
v |
number |
setPointSize(v, perspective)
Set the point size
Parameters
v |
number | |
perspective |
bool |
toGlobalMesh(buffers, indices)
Reuses a global mesh to avoid fragmenting the VRAM
Parameters
buffers |
* | |
indices |
* |