https://github.com/akbartus/a-frame-component-simplify-modifier
A-Frame Component for simplifying GLTF meshes, which is adaptation of Three.js example to A-Frame
https://github.com/akbartus/a-frame-component-simplify-modifier
aframevr mesh-simplification threejs
Last synced: about 1 month ago
JSON representation
A-Frame Component for simplifying GLTF meshes, which is adaptation of Three.js example to A-Frame
- Host: GitHub
- URL: https://github.com/akbartus/a-frame-component-simplify-modifier
- Owner: akbartus
- License: mit
- Created: 2023-06-16T05:41:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T19:21:53.000Z (about 3 years ago)
- Last Synced: 2025-02-28T19:26:49.757Z (over 1 year ago)
- Topics: aframevr, mesh-simplification, threejs
- Language: HTML
- Homepage: https://simplify-modifier.glitch.me/
- Size: 363 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A-Frame-Component: Simplify-Modifier

### **Description / Rationale**
This is A-Frame component for simplification of GLTF meshes. It is the adaptation of similar example made in Three.js with additional features:
* Simplification of multiple gltf meshes
* Assigning color to simplified mesh
* Enabling wireframe of simplified mesh.
### **Instructions**
In order to use the component attach "simplify-modifier" to a-entity with gltf-model component. The component has the following attributes:
* color: { type: 'color', default: '#ffffff' } - Color of the simplified mesh
* wireframe: { type: 'boolean', default: false } - Whether to show wireframe of simplified mesh or not
* count: { type: 'number', default: 0.7 } - Vertices to remove. Accepts values from 0 to 1. 0 - almost no simplifaction is made. 1 - complete simplification. Please note that if 1 is selected, mesh will not be visible.
* offset: { type: 'number', default: 1 } - Offset of simplified mesh on x-axis. If 0 is selected, it will be in the same position as original GLTF model.
The code below shows the sample implementation of the component:
```
A-Frame Component: Simplify Modifier
```
Please not that meshes without textures are only supported. When doing simplification if mesh is not visible, try to decrease the count value.
### **Tech Stack**
The project is powered by AFrame and Three.js. The 3d model (gltf file) was taken from Three.js repository.
### **Demo**
See demo of the component here: [Demo](https://simplify-modifier.glitch.me/)