replicator

A helper object for replicating 3D objects with controlled randomness.

Summary
replicatorA helper object for replicating 3D objects with controlled randomness.
Preference DialogNone.
CommentsThe replicator works by replicating an orginal object and place them in a 3 dimensional grids with given cell number in each dimension.
Properties
originobject, ( r, w )
dimobject, ( r, w )
mulobject, ( r, w )
rposobject, ( r, w )
roriobject, ( r, w )
rsclobject, ( r, w )
mergeGeometrybool, ( w )
Functions
run
stop
access

Preference Dialog

None.

Comments

The replicator works by replicating an orginal object and place them in a 3 dimensional grids with given cell number in each dimension.  Each cell has a fixed size that a user specifies.  Amount of randomness can be introduced to the position in the cell, the orientation, or the scale of each replicated object.

Properties

origin

object, ( r, w )

The origin of the 3d grid in Vector3.

dim

object, ( r, w )

The dimension of each cell in Vector3.

mul

object, ( r, w )

The number of cells in each dimension given by Vector3.

rpos

object, ( r, w )

Amount of randomness in position within each cell, given by a Vector3 with each component between 0.0 and 1.0.

rori

object, ( r, w )

Amount of randomness in rotation, given by a Vector3 with each component between 0.0 and 1.0.

rscl

object, ( r, w )

Amount of randomness in scale, given by a Vector3 with each component between 0.0 and 1.0.

mergeGeometry

bool, ( w )

Merge replicated vertices into one single mesh.  This would reduce the number of draw calls to the WebGL hardware and therefore increase rendering performance.

Functions

run

run(entity);

Start the replication of a given entity.

Parameters

entity(object) a mesh or a manualobject molecule.

Returns

N/A

stop

stop();

Stop replication and destroy all replicants.

Parameters

N/A

Returns

N/A

access

access(x_index, y_index, z_index);
access(index);

Returns the replicated object at the given index.

Parameters

x_index(int) index of x-dimension.
y_index(int) index of y-dimension.
z_index(int) index of z-dimension.
index(int) index to a sequential array of all replicated objects.

Returns

(object) a replicant.

Close