top

CAPH.WUI.ENGINE.RENDERING.PHONGMATERIAL

PhongMaterial is opposite to LambertMaterial, rendering shiny surfaces. This can show some fantastic effects when combined with the correct use of light evaluated per pixel.


Constructor

PhongMaterial

Description
Material phongMaterial method allows you to create a material for shiny 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.SphereGeometry().build(100, 100, 100);

var matrial = new AccRendering.PhongMaterial();
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 material to use
Parameters
■arg 
 - Object 
  - Arguments to create a THREE.MeshPhongMaterial. Refer to http://threejs.org/docs/#Reference/Materials/MeshPhongMaterial
Return■Object
  - An instance of THREE.MeshPhongMaterial
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

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

// Create a factory
var matrial = new AccRendering.PhongMaterial();
// Call material.build() to build a THREE.MeshPhongMaterial
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);

PhongMaterial

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

var basePage = new AccRendering.BasePage();

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

var matrial = new AccRendering.PhongMaterial();
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);