Geometry

I2Djs provides a way to define custom geometry using a set of inbuilt geometry APIs. Geometries are used along with custom shader to create out of the box effects.

I2Djs provides APIs for Mesh, line, and points geometry.

Mesh Geometry:

Used for rendering mesh geometrical polygons. Default drawType is 'TRIANGLES'. Possible values are 'TRIANGLES' , 'TRIANGLE_STRIP' and 'TRIANGLE_FAN'.

meshInstance = new MeshGeometry();

Example of Mesh Geometry:

meshInstance = new MeshGeometry();

geometry.setAttr('a_position', {
		value: new Float32Array([]),
		size: 2
	});
	
geometry.setDrawRange(0, 6);

Line Geometry:

Used for rendering Line geometrical entities like lines, polylines. Default drayType is 'LINE'. Possible values are 'LINE', 'LINE_STRIP' and 'LINE_LOOP'.

lineInstance = new LineGeometry();

Example of Line Geometry :

Points Geometry:

Used in rendering points. Default drawType is 'POINT'.

Example of Points Geometry :