Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamgio/vofxel
:zap: Voxel model loader and editor for JavaFX
https://github.com/iamgio/vofxel
3d java javafx library voxel
Last synced: 3 days ago
JSON representation
:zap: Voxel model loader and editor for JavaFX
- Host: GitHub
- URL: https://github.com/iamgio/vofxel
- Owner: iamgio
- License: gpl-3.0
- Created: 2019-09-07T11:55:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T14:13:22.000Z (over 5 years ago)
- Last Synced: 2024-11-10T13:19:50.522Z (2 months ago)
- Topics: 3d, java, javafx, library, voxel
- Language: Java
- Homepage:
- Size: 200 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vo(fx)el
**Vofxel** is a Java library for loading, displaying and editing PLY files exported from [MagicaVoxel](https://ephtracy.github.io/) into JavaFX, blazingly fast.## Installation
### Maven
```xml
jitpack.io
https://jitpack.io
com.github.iAmGio
vofxel
v0.0.2```
### Gradle
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.iAmGio:vofxel:v0.0.2'
}
```## Getting started
Load model from file:
```java
VoxelModel model = new VoxelModel();
root.getChildren().add(model);
model.load(getClass().getResourceAsStream("/file.ply"));
```> Note that the file must be exported using the _cube_ mode from MagicaVoxel (or any other tool that supports this export mode):
![Export](https://i.imgur.com/6jpqJFO.png)
Create model from scratch:
```java
VoxelModel model = new VoxelModel();
root.getChildren().add(model);
Cube cube1 = model.addCube();
cube1.setMaterial(new PhongMaterial(Color.RED));
cube1.moveZ(-10);
Cube cube2 = model.addCube();
cube2.setMaterial(new PhongMaterial(Color.BLUE));
cube2.moveX(-10);
```## Demo
A simple demonstration can be found [here](https://github.com/iAmGio/vofxel/blob/master/src/test/java/eu/iamgio/vofxel/AppTest.java).![Result](https://i.imgur.com/n6UJCJe.png)