top

CAPH.WUI.ENGINE.RENDERING.POINTLIGHT

PointLight can be referred to as a light bulb. It affects all LambertMaterial or PhongMaterial objects in the same way as long as they are within the range.


Constructor

PointLight

Description
Return a factory to construct a PointLight
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.PointLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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

Methods

build

Description
PointLight 'build' method is used to build PointLight object
Parameters
■hex
  - Number
  - Numeric value of the RGB component of the color. 
■intensity (Optional)
  - Number
  -Numeric value of the light's strength/intensity. 
■distance  (Optional)
  - Number
  - Numeric value of the distance.
Return■Object
  - An instance of THREE.PointLight
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.PointLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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

PointLight

Description
(Constructor) Return a factory to construct a PointLight
Parameters
■Void
Return■Object
  - An instance of PointLight
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.PointLight().build(0xFFFF00);
light.position.set(500, 0, 0);
basePage.scene.add(light);

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