top

CAPH.WUI.ENGINE.RENDERING.MESH3D

The skeleton that makes up the shape of the 3D objects is commonly referred to as the mesh. While using meshes, it is possible to use different materials to get different behaviors and interactions. A BasicMaterial will render as flat polygons, showing the model in flat color. Using a LambertMaterial will keep the object non-shiny surface. Most of the objects created in LambertMaterials are focused on the structure, rather than the aesthetics. PhongMaterial is the opposite to Lambert Material, rendering shiny surfaces. Phong Material can show fantastic effects when developed with the correct use of light.


Constructor

Mesh3d

Description
The constructor of Mesh3d component, in order to create Mesh3d object.
Parameters
geometry Objecttype of geometry It can be of following types : 'CubeGeometry', 'PlaneGeomtry', 'ShpereGeometry'
material Object type of geometry It can be of following types : 'mesh'
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 }));

obj.addEvent('click', eventFn);

basePage.add(object);

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

function eventFn() {
    obj.setXPosition(obj.getXPosition()+10);
}

Methods

addEvent

Description
Object.Mesh3d 'addEvent' method allows you to add event of Mesh3d Element. This method takes type and listener as arguments.
Parameters
■type
  - Object
  - type of event It can be of following types : 'click', 'touch', 'release','drag','dragstart','dragend', 'swipe', 'swipeleft', 'swiperight', 'swipeup','swipedown','pinch','transformstart','transform','transformend'    
  - listener  :  listener attache
Return■Void
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 }));

obj.addEvent('click', eventFn);

basePage.add(object);

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

function eventFn() {
    obj.setXPosition(obj.getXPosition()+10);
}

applyMatrix

Description
caph.wui.engine.rendering.Mesh3d 'applyMatrix' method allows you multiply 4x4 matrix to the Mesh3d Object. This method takes 16 matrix values as arguments.
Parameters
■m1, m2, m3,..., m16
  - Object 
  - 4x4 matrix values
Return■Void
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 }));

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

basePage.add(object);

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

setPosition

Description
Object.Mesh3d 'setPosition' method allows you to change X,Y,Z position of Mesh3d Element . 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 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 }));

obj.setPosition(100, 100, 100);

basePage.add(object);

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

getPosition

Description
caph.wui.engine.rendering.Mesh3d 'getPosition' method return object position.This method does not take any argument
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 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 }));

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

basePage.add(object);

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

getXPosition

Description
caph.wui.engine.rendering.Mesh3d 'getXPosition' method return object x position.This method does not take any argument
Parameters
■Void
Return■Number
  - integer (object's position  x value)
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 }));

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

basePage.add(object);

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

getYPosition

Description
caph.wui.engine.rendering.Mesh3d 'getYPosition' method return object y position.This method does not take any argument.
Parameters
■Void
Return■Number
  - integer(object's position y value)
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 }));

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

basePage.add(object);

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

getZPosition

Description
caph.wui.engine.rendering.Mesh3d 'getZPosition' method return object z position.This method does not take any argument.
Parameters
■Void
Return■Number
  - integer(object's position z value)
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 }));

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

basePage.add(object);

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

setRotation

Description
caph.wui.engine.rendering.Mesh3d 'setRotation' method allows you to change X,Y,Z rotation of Mesh3d Element . 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 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 }));

obj.setRotation(0.1, 0.1, 0);

basePage.add(object);

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

getRotation

Description
caph.wui.engine.rendering.Mesh3d 'getRotation' method return rotation of Mesh3d Element. This method does not take any argument.
Parameters
■Void
Return■Object
  - Object
  - x : x value, y : y value, z : z value
  - Object of x rotation, y rotation, z rotation values
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 }));

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

basePage.add(object);

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

getXRotation

Description
caph.wui.engine.rendering.Mesh3d 'getXRotation' method allows you to get x rotation of Mesh3d Element.
Parameters
■Void
Return■Number
  - integer (object x rotation value)
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 }));

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

basePage.add(object);

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

getYRotation

Description
caph.wui.engine.rendering.Mesh3d 'getYRotation' method allows you to get y rotation of Mesh3d Element.
Parameters
■Void
Return■Number
  - integer (object y rotation  value)
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 }));

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

basePage.add(object);

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

getZRotation

Description
caph.wui.engine.rendering.Mesh3d 'getZRotation' method allows you to get z rotation of Mesh3d Element.
Parameters
■Void
Return■Number
  - integer (object z rotation value)
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 }));

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

basePage.add(object);

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

setRotationOrigin

Description
caph.wui.engine.rendering.Mesh3d 'setRotationOrigin' method used to set rotation origin of Mesh3d object, 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
  - x coordinate of the required Origin point.    
■y
  - Number
  - y coordinate of the required Origin point.    
■z
  - Number
  - z coordinate of the required Origin point.    
■degX
  - Number
  - Amount of degree to rotate around x axis.
■degY
  - Number 
  - Amount of degree to rotate around y axis.
Return■Number
  - 1 : fails
  - undefined : otherwise.
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 }));

obj.setRotationOrigin(300, 300, 100, 0.2, 0.2, 0.2);

basePage.add(object);

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

setScale

Description
caph.wui.engine.rendering.Mesh3d 'setScale' method allows you to scale Mesh3d Element. This method takes x,y,z as argument.
Parameters
■x
  - Number
  - x value of required scale   
■y
  - Number
  - y value of required scale
■z
  - Number
  - z value of required scale
Return■Void
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 }));

obj.setScale(1.5, 1.5, 1.5);

basePage.add(object);

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

getScale

Description
caph.wui.engine.rendering.Mesh3d 'getScale' method returns scale object with x, y ,z scale values of DOM Element.
Parameters
■Void
Return■Object
  - scale object
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 }));

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

basePage.add(object);

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

getXScale

Description
caph.wui.engine.rendering.Mesh3d '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 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 }));

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

basePage.add(object);

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

getYScale

Description
caph.wui.engine.rendering.Mesh3d '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 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 }));

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

basePage.add(object);

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

getZScale

Description
caph.wui.engine.rendering.Mesh3d 'getZScale' method returns scale z value of DOM Element.
Parameters
■Void
Return■Number
  - integer (object's scale z value)
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 }));

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

basePage.add(object);

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

setXPosition

Description
caph.wui.engine.rendering.Mesh3d 'setXPosition' method allows you to change X Position of Mesh3d Element. This method takes an x coordinate 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 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 }));

obj.setXPosition(100);

basePage.add(object);

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

setXRotation

Description
caph.wui.engine.rendering.Mesh3d 'setXPosition' method allows you to change X Position of WebGL Element. This method takes an x coordinate 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 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 }));

obj.setXRotation(0.1);

basePage.add(object);

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

setXRotationOrigin

Description
caph.wui.engine.rendering.Mesh3d 'setXRotationOrigin' method allows you to rotate around X axis from origin point x, y, z. This method takes an x,y,z,degX as arguments.
Parameters
■x 
  - Number
  - x coordinate of the required Origin point.    
■y 
  - Number  
  - y coordinate of the required Origin point.    
■z 
  - Number
  - z coordinate of the required Origin point.    
■degX 
  - Number 
  - Amount of degree to rotate around x axis.
Return■Void
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 }));

obj.setXRotationOrigin(300, 300, 100, 0.2);

basePage.add(object);

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

setXScale

Description
caph.wui.engine.rendering.Mesh3d 'setXScale' method allows you to set x scale of Mesh3d object. This method takes x value argument.
Parameters
■x 
  - Number
  - x value of required scale
Return■Void
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 }));

obj.setXScale(1.5);

basePage.add(object);

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

setYPosition

Description
caph.wui.engine.rendering.Mesh3d 'setYPosition' method allows you to change Y Position of Mesh3d Element. This method takes an y coordinate 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 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 }));

obj.setYPosition(100);

basePage.add(object);

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

setYRotation

Description
caph.wui.engine.rendering.Mesh3d 'setYPosition' method allows you to change Y Position of WebGL Element. This method takes an y coordinate 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 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 }));

obj.setYRotation(0.1);

basePage.add(object);

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

setYRotationOrigin

Description
caph.wui.engine.rendering.Mesh3d 'setYRotationOrigin' method allows you to rotate around Y axis from origin point x, y, z. This method takes an x,y,z,degY as arguments.
Parameters
■x
  - Number
  - x coordinate of the required Origin point.    
■y
  - Number  
  - y coordinate of the required Origin point.    
■z
  - Number
  - z coordinate of the required Origin point.    
■degY
  - Number 
  - Amount of degree to rotate around y axis.
Return■Void
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 }));

obj.setYRotationOrigin(300, 300, 100, 0.2);

basePage.add(object);

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

setYScale

Description
caph.wui.engine.rendering.Mesh3d 'setYScale' method allows you to set y scale of Mesh3d object. This method takes y value argument.
Parameters
■y
  - Number
  - y value of required scale
Return■Void
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 }));

obj.setYScale(1.5);

basePage.add(object);

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

setZPosition

Description
caph.wui.engine.rendering.Mesh3d 'setZPosition' method allows you to change Z Position of Mesh3d Element. This method takes an z coordinate 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 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 }));

obj.setZPosition(100);

basePage.add(object);

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

setZRotation

Description
caph.wui.engine.rendering.Mesh3d 'setZRotation' method allows you to change Z rotation of Mesh3d Element. This method takes a z coordinate 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 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 }));

obj.setZRotation(0.1);

basePage.add(object);

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

setZRotationOrigin

Description
caph.wui.engine.rendering.Mesh3d 'setZRotationOrigin' method allows you to rotate around Z axis from origin point x, y, z. This method takes an x,y,z,degZ as arguments.
Parameters
■x
  - Number
  - x coordinate of the required Origin point.    
■y
  - Number
  - y coordinate of the required Origin point.    
■z
  - Number
  - z coordinate of the required Origin point.    
■degZ
  - Number
  - Amount of degree to rotate around z axis.
Return■Void
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 }));

obj.setZRotationOrigin(300, 300, 100, 0.2);

basePage.add(object);

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

setZScale

Description
caph.wui.engine.rendering.Mesh3d 'setZScale' method allows you to set z scale of Mesh3d object. This method takes z value argument.
Parameters
■z
  - Number
  - z value of required scale
Return■Void
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 }));

obj.setZScale(1.5);

basePage.add(object);

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

Mesh3d

Description
(Constructor) The constructor of Mesh3d component, in order to create Mesh3d object.
Parameters
■geometry
  - Object
  - type of geometry It can be of following types : 'CubeGeometry', 'PlaneGeomtry', 'ShpereGeometry'
 
■material
  - Object
  - type of geometry It can be of following types : 'mesh'
Return■Object
  - instance of Mesh3d
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 }));

obj.addEvent('click', eventFn);

basePage.add(object);

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

function eventFn() {
    obj.setXPosition(obj.getXPosition()+10);
}