top

CAPH.WUI.ENGINE.RENDERING.DIRECTIONALLIGHT

A light source that shines from a specific direction not from a specific position. This light will behave as though it is infinitely far away and the rays produced from it are all parallel. The best analogy would be a light source that acts like the sun; the sun is so far away that all sunlight hitting objects comes from the same angle. Affects objects using LambertMaterial or PhongMaterial.


Constructor

build

Description
DirectionalLight 'build' method is used to build DirectionalLight object
Parameters
hex NumberNumeric value of the RGB component of the color.
intensity Number Numeric value of the light's strength/intensity.
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.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var light = new AccRendering.DirectionalLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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

DirectionalLight

Description
DirectionalLight 'build' method is used to build DirectionalLight object. Return a factory to create a DirectionalLight.
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.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var light = new AccRendering.DirectionalLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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

Methods

build

Description
(Constructor) DirectionalLight 'build' method is used to build DirectionalLight object
Parameters
■hex
  - Number
  - Numeric value of the RGB component of the color. 
■intensity (Optional)
  - Number
  - Numeric value of the light's strength/intensity.
Return■Object
  - An instance of THREE.DirectionalLight
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.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var light = new AccRendering.DirectionalLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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

DirectionalLight

Description
(Constructor) DirectionalLight 'build' method is used to build DirectionalLight object. Return a factory to create a DirectionalLight.
Parameters
■Void
Return■Object
  - An instance of DirectionalLight
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.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));

basePage.add(object);

var light = new AccRendering.DirectionalLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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