Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/adarosecannon/aframe-surface-scatter
- Owner: AdaRoseCannon
- Created: 2022-06-29T15:58:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T13:47:51.000Z (about 2 years ago)
- Last Synced: 2024-11-02T06:11:40.963Z (3 months ago)
- Topics: aframe, aframevr, threejs
- Language: JavaScript
- Homepage: https://ada.is/aframe-surface-scatter
- Size: 342 KB
- Stars: 15
- Watchers: 3
- 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)
![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 |