top

CAPH.WUI.ENGINE.RENDERING.LAMBERTMATERIAL

A material for non-shiny (Lambertian) surfaces. Using a LambertMaterial will keep light from reflecting off from the surface. In many cases, 3D Object created with LambertMaterials focus on the structure, rather than the aesthetic. LambertMaterial is evaluated per vertex.


Constructor

LambertMaterial

Description
Material 'lambertMaterial' method allows you to create a material for non-shiny (Lambertian) surfaces . This method doesn't take any argument
Emulator SupportY
SDK ConstraintNone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

var matrial = new AccRendering.LambertMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

Methods

build

Description
Build a Lambertian material to use
Parameters
■arg
  - Object
  - Arguments to create a THREE.MeshLambertMaterial. Refer to http://threejs.org/docs/#Reference/Materials/MeshLambertMaterial
Return■Object
  - An instance of THREE.MeshLambertMaterial
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

// Create a factory
var matrial = new AccRendering.LambertMaterial();
// Call material.build() to build a THREE.MeshLambertMaterial
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

LambertMaterial

Description
(Constructor) Material 'lambertMaterial' method allows you to create a material for non-shiny (Lambertian) surfaces . This method doesn't take any argument
Parameters
■Void
Return■Object
  - A factory to create LambertMaterial
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

var matrial = new AccRendering.LambertMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);