Skip to content
⚡️ Voxel model loader and editor for JavaFX
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
pom.xml

README.md

Vo(fx)el

Vofxel is a Java library for loading, displaying and editing PLY files exported from MagicaVoxel into JavaFX, blazingly fast.

Installation

Maven

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>
<dependency>
  <groupId>com.github.iAmGio</groupId>
  <artifactId>vofxel</artifactId>
  <version>v0.0.2</version>
</dependency>

Gradle

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  implementation 'com.github.iAmGio:vofxel:v0.0.2'
}

Getting started

Load model from file:

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

Create model from scratch:

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.

Result

You can’t perform that action at this time.