top

CAPH.WUI.ENGINE.RENDERING.CUBEGEOMETRY

CubeGeometry is typically used for creating a cube with user defined 'width', 'height', and 'depth' constructor arguments.


Constructor

CubeGeometry

Description
Geometry 'CubeGeometry' method allows you to create cube geometry for an object. Return a factory to create CubeGeometry.
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.BasicMaterial();
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
Geometry 'CubeGeometry' method allows you to create cube geometry for an object.
Parameters
■width
  - Number
  - Width of the sides on the X axis.    
■height
  - Number   
  - Height of the sides on the Y axis.    
■depth
  - Number   
  - Depth of the sides on the Z axis.    
■widthSegments (Optional)
  - Number
  - Optional. Number of segmented faces along the width of the sides. Default is 1.
■heightSegments (Optional)
  - Number
  - Optional. Number of segmented faces along the height of the sides. Default is 1.
■depthSegments (Optional)
  - Number 
  - Number of segmented faces along the depth of the sides. Default is 1.
Return■Object
  - An instance of THREE.CubeGeometry
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.BasicMaterial();
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);

CubeGeometry

Description
(Constructor) Geometry 'CubeGeometry' method allows you to create cube geometry for an object. Return a factory to create CubeGeometry.
Parameters
■Void
Return■Object
  - A factory create a CubeGeometry
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.BasicMaterial();
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);