top

CAPH.WUI.ENGINE.RENDERING.COMMONOBJECT

CommonObject basically provides basic methods for CssObjects and Mesh3D classes. Basic methods include 'setXPosition', 'setYPosition', 'setZPosition', 'setPosition', 'setXRotation' and so on.


Constructor

CommonObject

Description
The constructor of CommonObject, in order to create CommonObject object.
Emulator SupportY
SDK ConstraintNone
Example
var AccRendering = caph.wui.engine.rendering;
var obj = new AccRendering.CommonObject();

Methods

setPosition

Description
caph.wui.engine.rendering.CommonObject 'setPosition' method used to change X,Y,Z position of CommonObject . This method takes an x,y,z as an argument.
Parameters
■x
  - Number
  - The coordinates of the required x position.
■y
  - Number
  - The coordinates of the required y position.
■z
  - Number
  - The coordinates of the required z position.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setPosition(100, 100, 100);

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

getPosition

Description
caph.wui.engine.rendering.CommonObject 'getPosition' method allows you to get X,Y,Z position value of DOM Element.
Parameters
■Void
Return■Object
  - Object
  - x : x value, y : y value, z : z value
  - Object of x coordinate, y coordinate, z coordinate values
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setPosition(100, 100, 100);
obj.getPosition();

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

getXPosition

Description
caph.wui.engine.rendering.CommonObject 'getXPosition' method allows you to get X position value of DOM Element.
Parameters
■Void
Return■Number
  - The coordinate in pixels
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setPosition(100, 100, 100);
obj.getXPosition();

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

getYPosition

Description
caph.wui.engine.rendering.CommonObject 'getYPosition' method allows you to get Y position value of DOM Element.
Parameters
■Void
Return■Number
  - The coordinate in pixels
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setPosition(100, 100, 100);
obj.getYPosition();

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

getZPosition

Description
caph.wui.engine.rendering.CommonObject 'getZPosition' method allows you to get Z position value of DOM Element.
Parameters
■Void
Return■Number
  - The coordinate in pixels
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setPosition(100, 100, 100);
obj.getZPosition();

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

setRotation

Description
caph.wui.engine.rendering.CommonObject 'setRotation' method used to set rotation around X, Y and Z axis . This method takes an x,y,z as an argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
■y
  - Number
  - The coordinates of the required  y rotation
■z
  - Number
  - The coordinates of the required  z rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotation(0.1, 0.1, 0);

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

getRotation

Description
caph.wui.engine.rendering.CommonObject 'getRotation' method return rotation object with x, y, z values of DOM Element.
Parameters
■Void
Return■Object
  - Object
  - x : x value, y : y value, z : z value
  - Object of x rotate, y rotate, z rotate values
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotation(0.1, 0.1, 0);
obj.getRotation();

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

getXRotation

Description
caph.wui.engine.rendering.CommonObject 'getXRotation' method return X rotation value of DOM Element.
Parameters
■Void
Return■Number
  - The rotation value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotation(0.1, 0.1, 0);
obj.getXRotation();

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

getYRotation

Description
caph.wui.engine.rendering.CommonObject 'getYRotation' method return Y rotation value of DOM Element.
Parameters
■Void
Return■Number
  - The rotation value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotation(0.1, 0.1, 0);
obj.getYRotation();

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

getZRotation

Description
caph.wui.engine.rendering.CommonObject 'getZRotation' method return Z rotation value of DOM Element.
Parameters
■Void
Return■Number
  - The rotation value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotation(0.1, 0.1, 0);
obj.getZRotation();

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

setRotationOrigin

Description
caph.wui.engine.rendering.CommonObject 'setRotationOrigin' method used to set rotation origin of CommonObject, rotated around X, Y and Z axis with given degrees respectively. This method takes an x,y,z,degX,degY,degZ as argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
■y
  - Number
  - The coordinates of the required  y rotation
■z
  - Number
  - The coordinates of the required  z rotation
■degx
  - Number
  - The rotation value of the required  x rotation
■degy
  - Number
  - The rotation value of the required  y rotation
■degz
  - Number
  - The rotation value of the required  z rotation
Return■Number
  - -1 : if fails
  - undefined : otherwise.
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setRotationOrigin(300, 300, 0, 0.1, 0.1, 0.1);

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

setScale

Description
caph.wui.engine.rendering.CommonObject 'setScale' method used to scale CommonObject along x, y,z direction. This method takes x,y,z as argument.
Parameters
■x
  - Number
  - x values required scale
■y
  - Number
  - y values required scale
■z
  - Number
  - z values required scale
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setScale(1.5, 1.5, 1.5);

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

getScale

Description
caph.wui.engine.rendering.CommonObject 'getScale' method returns scale object with x, y ,z scale values of DOM Element.
Parameters
■Void
Return■Object
  - Object
  - {x: x value, y: y value, z: z value}
Object of x scale, y scale z scale values
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setScale(2, 2, 2);
obj.getScale();

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

getXScale

Description
caph.wui.engine.rendering.CommonObject 'getXScale' method returns scale x value of DOM Element.
Parameters
■Void
Return■Number
  - integer
  - object's scale x value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setScale(2, 2, 2);
obj.getXScale();

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

getYScale

Description
caph.wui.engine.rendering.CommonObject 'getYScale' method returns scale y value of DOM Element.
Parameters
■Void
Return■Number
  - integer
  - object's scale y value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setScale(2, 2, 2);
obj.getYScale();

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

getZScale

Description
caph.wui.engine.rendering.CommonObject 'getYScale' method returns scale y value of DOM Element.
Parameters
■Void
Return■Number
  - object's scale z value
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setScale(2, 2, 2);
obj.getZScale();

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

setXRotation

Description
caph.wui.engine.rendering.CommonObject 'setRotation' method used to set rotation around X, Y and Z axis . This method takes an x,y,z as an argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setXRotation(0.1);

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

setXRotationOrigin

Description
caph.wui.engine.rendering.CommonObject 'setXRotationOrigin' method used to set rotation origin of CommonObject around X axis to a given degree from origin point x, y, z. This method takes an x,y,z,deg as argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
■y
  - Number
  - The coordinates of the required  y rotation
■z
  - Number
  - The coordinates of the required  z rotation
■degx
  - Number
  - The rotation value of the required  x rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setXRotationOrigin(300, 300, 0, 0.1);

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

setXScale

Description
caph.wui.engine.rendering.CommonObject 'setYScale' method used to scale CommonObject along y direction. This method takes y scale value as arguments
Parameters
■x
  - Number
  - x values required scale
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setXScale(1.5);

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

setYRotation

Description
caph.wui.engine.rendering.CommonObject 'setRotation' method used to set rotation around X, Y and Z axis . This method takes an x,y,z as an argument.
Parameters
■y
  - Number
  - The coordinates of the required y rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setYRotation(0.1);

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

setYRotationOrigin

Description
caph.wui.engine.rendering.CommonObject 'setXRotationOrigin' method used to set rotation origin of CommonObject around Y axis to a given degree from origin point x, y, z. This method takes an x,y,z,deg as argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
■y
  - Number
  - The coordinates of the required  y rotation
■z
  - Number
  - The coordinates of the required  z rotation
■degy
  - Number
  - The rotation value of the required y rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setYRotationOrigin(300, 300, 0, 0.1);

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

setYScale

Description
caph.wui.engine.rendering.CommonObject 'setYScale' method used to scale CommonObject along y direction. This method takes y scale value as arguments
Parameters
■y
  - Number
  - y values required scale
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setYScale(1.5);

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

setZRotation

Description
caph.wui.engine.rendering.CommonObject 'setRotation' method used to set rotation around X, Y and Z axis . This method takes an x,y,z as an argument.
Parameters
■z
  - Number
  - The coordinates of the required z rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setZRotation(0.1);

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

setZRotationOrigin

Description
caph.wui.engine.rendering.CommonObject 'setZRotationOrigin' method used to set rotation origin of CommonObject around Z axis to a given degree from origin point x, y, z. This method takes an x,y,z,deg as argument.
Parameters
■x
  - Number
  - The coordinates of the required  x rotation
■y
  - Number
  - The coordinates of the required  y rotation
■z
  - Number
  - The coordinates of the required  z rotation
■degz
  - Number
  - The rotation value of the required z rotation
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setZRotationOrigin(300, 300, 0, 0.1);

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

setZScale

Description
caph.wui.engine.rendering.CommonObject 'setZScale' method used to scale CommonObject along z direction. This method takes z scale value as arguments
Parameters
■z
  - Number
  - z values required scale
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CommonObject(element);
basePage.add(obj);

obj.setZScale(1.5);

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

applyMatrix

Description
caph.wui.engine.rendering.CommonObject 'applyMatrix' method allows you multiply 4x4 matrix to the CSSObject Object. This method takes 16 matrix values as arguments.
Parameters
■m1, m2, m3,..., m16
  - Number
  - 4x4 matrix values
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var basePage = new AccRendering.BasePage();

var element = document.createElement('div');
element.style.width = '100px';
element.style.height = '100px';
element.style.background = '#00AAAA';

var obj = new AccRendering.CssObject(element);
basePage.add(obj);

obj.applyMatrix(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,300,0,1);

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

CommonObject

Description
(Constructor) The constructor of CommonObject, in order to create CommonObject object.
Parameters
■Void
Return■Object
  - An instance of CommonObject
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var obj = new AccRendering.CommonObject();

setXPosition

Description
caph.wui.engine.rendering.CommonObject 'setPosition' method used to change X position of CommonObject . This method takes an x as an argument.
Parameters
■x
  - Number
  - The coordinates of the required x position.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var obj = new AccRendering.CommonObject();
obj.setXPosition(100);

setYPosition

Description
caph.wui.engine.rendering.CommonObject 'setPosition' method used to change Y position of CommonObject . This method takes an y as an argument.
Parameters
■y
  - Number
  - The coordinates of the required y position.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var obj = new AccRendering.CommonObject();
obj.setYPosition(100);

setZPosition

Description
caph.wui.engine.rendering.CommonObject 'setPosition' method used to change Z position of CommonObject . This method takes an z as an argument.
Parameters
■z
  - Number
  - The coordinates of the required z position.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;
var obj = new AccRendering.CommonObject();
obj.setZPosition(100);