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

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

Awesome Lists containing this project

README

          

# A-Frame-Component: Simplify-Modifier
Video screen capture

### **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/)