API Documentation

for 0.0.1
Show:

Material Class

A material will give color and some effect to the surface of the 3D object. Mobilizing.js is heavily based on the one of Three.js http://threejs.org/docs/#Reference/Materials/Material and its variations

Constructor

Material

(
  • params
)

Parameters:

  • params Object

    an object containing all the possible parameters for this class. Use it like in the following example. Possible parameters are lisited below.

    • [type="basic"] String optional

      the type of the matrial, one of "basic", "projectionmapping", "phong", "line", "sprite"

Example:

//this is how to use a parameters object in order to instanciate a Mobilizing.js object
var mobilizingObject = new Mobilizing.Class({paramName1: value, paramName2: value});

Methods

getAlphaTest

() Number

Returns:

Number:

getColor

() Color

Returns:

getDoubleSided

() Boolean

Returns:

Boolean:

getEmissiveColor

() Color

Returns:

getLineWidth

() Number

Returns:

Number:

getOpacity

() Float

Returns:

Float:

getPointSize

() Number

Returns:

Number:

getShininess

() Number

Returns:

Number:

getSpecularColor

() Color

Returns:

getTexture

() Texture

Gets the current texture

Returns:

getTransparent

() Boolean

Returns:

Boolean:

getWireframe

() Boolean

Returns:

Boolean:

setAlphaTest

(
  • val
)

Parameters:

  • val Number

    between 0 and 1

setBlending

(
  • name
)

Parameters:

  • name String

setColor

(
  • color
)

Parameters:

setDepthTest Sets the depth test.

(
  • bool
)

Parameters:

  • bool Boolean
    • The depthTest value

setDepthWrite Sets the depth write.

(
  • bool
)

Parameters:

  • bool Boolean
    • The depthWrite value

setDoubleSided

(
  • sided
)

Parameters:

  • sided Boolean

setEmissiveColor

(
  • color
)

Parameters:

setLineWidth

(
  • val
)

Parameters:

  • val Number

setOpacity

(
  • op
)

Parameters:

  • op Float

    between 0 and 1

setPointSize

(
  • val
)

Parameters:

  • val Number

setProperty

(
  • name
)
Object

Parameters:

  • name String

Returns:

Object:

value (depending on the property)

setProperty

(
  • name
  • value
)

Parameters:

  • name String
  • value Object

    (depending on the property)

setShading

(
  • shading
)

Parameters:

  • shading String

    one of "smooth", "flat"

setShininess

(
  • color
)

Parameters:

  • color Number

setSpecularColor

(
  • color
)

Parameters:

setTexture

(
  • texture
)

set the texture

Parameters:

setTransparent

(
  • trans
)

Parameters:

  • trans Boolean

setUniform

(
  • name
  • value
)

Parameters:

  • name String

    the name of the uniform to set

  • value Object

    the value of the uniform to set

setWireframe

(
  • wireframe
)

Parameters:

  • wireframe Boolean