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: about 1 year ago
JSON representation
Position objects randomly over an objects surface
- Host: GitHub
- URL: https://github.com/adarosecannon/aframe-surface-scatter
- Owner: AdaRoseCannon
- Created: 2022-06-29T15:58:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T13:47:51.000Z (over 3 years ago)
- Last Synced: 2025-04-14T16:21:43.450Z (about 1 year ago)
- Topics: aframe, aframevr, threejs
- Language: JavaScript
- Homepage: https://ada.is/aframe-surface-scatter
- Size: 342 KB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AFrame-surface-scatter
[Demo](https://ada.is/aframe-surface-scatter)

## 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 |