simple wavefront file writer
about
This is a very simple writer for the Wavefront .obj file format describing 3D models.
The project homepage is at https://github.com/mmitch/wavefront-simple
example
This code
// generate a cube at (0, 0, 0) with edge length 1
Cube cube = new Cube(Coordinate.ORIGIN, 1);
// write object to file
cube.writeTo(new FileOutputStream("/tmp/cube.obj"));
creates an .obj
file that looks like this:
V 0 0 0
V 0 0 1
V 0 1 0
V 0 1 1
V 1 0 0
V 1 0 1
V 1 1 0
V 1 1 1
f 1 3 4 2
f 1 3 7 5
f 1 5 6 2
f 2 4 8 6
f 3 7 8 4
f 5 7 8 6
usage
This is a library, no standalone program (although test executables
are available in the de.cgarbs.wavefront.test.app
package).
To include wavefront-simple
in your project, add this to your
build.gradle
:
repositories {
repositories {
maven {
name "cgarbs.de repo"
url "https://www.cgarbs.de/maven2"
}
}
}
dependencies {
compile 'de.cgarbs:wavefront-simple:0.6.0'
}
Note: You should propably update the version number (0.6.0
in the
example above) to the most current version (see the HISTORY.md
file).
The same coordinates should work for Maven projects, too.
build
Just run gradle
, the project will configure, compile and then run the checks.
dependencies
- Java 8
- Gradle
- further dependencies are fetched automatically, see
build.gradle
further plans
- centralize tests from Container subclasses into ContainerTest
- add rotation operation(?)
- add colors/textures(?)
copyright
wavefront-simple - generate simple 3D models in Wavefront .obj file format
Copyright (C) 2016 Christian Garbs <[email protected]>
Licensed under GNU GPL v3 (or later)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.