Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adarosecannon/aframe-surface-scatter

Position objects randomly over an objects surface
https://github.com/adarosecannon/aframe-surface-scatter

aframe aframevr threejs

Last synced: 3 months ago
JSON representation

Position objects randomly over an objects surface

Awesome Lists containing this project

README

        

# AFrame-surface-scatter

[Demo](https://ada.is/aframe-surface-scatter)

![Screenshot of a 3D rendered field of grass with flowers](https://user-images.githubusercontent.com/4225330/176483332-1135d75d-d1fe-4e30-87ce-5852e2ce5c34.png)

## Simple Example
```html

```

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

```html

```

### surface-scatter component

This component uses instancing to cover one object in another.

| Property | Type | Description | Default |
| :-------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| object | selector | Object to place on the surface of this object | |
| count | number | Amount of objects | 128 |
| weightAttribute | string | Specifies 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. | "" |
| scale | vec3 | Amount to scale the objects by | {} |
| rotation | vec3 | Amount to rotate the objects by | {} |
| scaleJitter | vec3 | Add randomness to the scaling | {} |
| rotationJitter | vec3 | Add randomness to the rotation | {} |
| uniformJitter | boolean | Scale x,y,z together (true) or each independently (false) | true |