1.1.0 • Published 2 years ago

aframe-surface-scatter v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

AFrame-surface-scatter

Demo

Screenshot of a 3D rendered field of grass with flowers

Simple Example

<a-cylinder radius="0.02" height="0.04" color="red"></a-cylinder>
<a-sphere radius="0.5" position="0 1 -2" surface-scatter="object:#decoration;count:800;"><a-sphere>

You can use multiple surface-scatter components by appending __name to the component e.g.

<a-sphere radius="0.5" surface-scatter__flowers="object:#flowers;count:800;" surface-scatter__trees="object:#trees;count:20;"><a-sphere>

surface-scatter component

This component uses instancing to cover one object in another.

PropertyTypeDescriptionDefault
objectselectorObject to place on the surface of this object
countnumberAmount of objects128
weightAttributestringSpecifies a vertex attribute to be used as a weight when sampling from the surface. Faces with higher weights are more likely to be sampled, and those with weights of zero will not be sampled at all. For vector attributes, only .x is used in sampling. If no weight attribute is selected, sampling is randomly distributed by area.""
scalevec3Amount to scale the objects by{}
rotationvec3Amount to rotate the objects by{}
scaleJittervec3Add randomness to the scaling{}
rotationJittervec3Add randomness to the rotation{}
uniformJitterbooleanScale x,y,z together (true) or each independently (false)true
1.1.0

2 years ago

1.0.1

2 years ago