top

CAPH.WUI.ENGINE.RENDERING.SPHEREGEOMETRY

SphereGeometry is typically used for creating a sphere with user defined 'radius', 'number of widthSegments' and 'number of heightSegments'


Constructor

SphereGeometry

Description
Geometry 'SphereGeometry' method allows you to create sphere geometry for an object. This method doesn't take any argument. Return a factory to create SphereGeometry.
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 renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

Methods

SphereGeometry

Description
(Constructor) Geometry 'SphereGeometry' method allows you to create sphere geometry for an object. This method doesn't take any argument. Return a factory to create SphereGeometry.
Parameters
■Void
Return■Object
  - A factory to create SphereGeometry
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 renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

build

Description
Geometry 'SphereGeometry' method allows you to create sphere geometry for an object.
Parameters
■radius (Optional)
  - Number
  - sphere radius. 
  - [default : 50]
■widthSegments (Optional)
  - Number
  - number of horizontal segments. Minimum value is 3
  - [default : 8]
■heightSegments (Optional)
  - Number
  - number of vertical segments. Minimum value is 2
  - [default : 6]
■phiStart (Optional)
  - Number  
  - specify horizontal starting angle. 
  - [default : 0]
■phiLength (Optional)
  - Number
  - specify horizontal sweep angle size. 
  - [default : Math.PI * 2]
■thetaStart (Optional)
  - Number
  - specify vertical starting angle. 
  - [default : 0]
■thetaLength (Optional)
  - String
  - specify vertical sweep angle size. 
  - [default : Math.PI]
Return■Object
  - An instance of THREE.SphereGeometry
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 renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);