Namespace vxl.util

Voxelent Util methods

Namespace

vxl.util
Utility functions

Methods

<static> createArr3(x, y, z)
Creates an array from a set of parameters

Parameters:

Type Name Description
Array|vec3|Number x

it can be an Array, a vec3 or a number

Number y

if x is a number, this parameter corresponds to the y-component

Number z

if x is a number, this parameter corresponds to the z-component

<static> createColor(r, g, b)

Parameters:

Type Name Description
r

g

b

<static> createVec3(x, y, z)
Creates a vector from a set of parameters

Parameters:

Type Name Description
Array|vec3|Number x

it can be an Array, a vec3 or a number

Number y

if x is a number, this parameter corresponds to the y-component

Number z

if x is a number, this parameter corresponds to the z-component

<static> deg2rad(deg)
Converts degrees to radians

Parameters:

Type Name Description
deg

<static> doTimer(length, resolution, oninstance, oncomplete)

Parameters:

Type Name Description
length

resolution

oninstance

oncomplete

<static> extend()
<static> format(arr, digits)
Formats Arrays, vec3 and vec4 for display

Parameters:

Type Name Description
Array|vec3|vec4 arr

the object to format

Number digits

the number of decimal figures

<static> frac2rgb(r, g, b)

Parameters:

Type Name Description
r

g

b

<static> generateUID()
<static> getAngle(angle)
Returns an angle between 0 and 360 deg

Parameters:

Type Name Description
angle

<static> getPath(path)

Parameters:

Type Name Description
path

<static> hex2rgb(hex)
This function is attributed to Tim Down

Parameters:

Type Name Description
hex

<static> int2rgb(i)
Returns a RGB color based on an integer (0..16 millions?)

Parameters:

Type Name Description
i

<static> isMac()
<static> rgb2decimal(rgb)
Rescales the color from [0,255] to [0,1]WebGL uses [0,1] range

Parameters:

Type Name Description
rgb

<static> rgb2frac(r, g, b)

Parameters:

Type Name Description
r

g

b

<static> rgb2hex(r, g, b)

Parameters:

Type Name Description
r

g

b