Augmented Reality Voxel Editor is a tool that allows you to create amazing voxelized graphic models like if it were 3D pixel art :)
Since it's not very practical to make them using augmented reality techniques, the outcomes are really enjoyable and nice to see; you can explore the created model by rotating it or by bringing it near to the camera.
Some ideas for this tool have been retrieved from Carlos Gonzalez's 3D Paint Tool.
- Install a copy of ARToolKit.
- Install the
freeglut-dev
package for your GNU/Linux distro. - Clone this repository.
- Edit the
makefile
to point the ARTOOLKITDIR variable to your ARToolKit installation directory. make
- Launch it :)
In order to use the application, you need to print the multipattern used as canvas and the marker used as brush. When printed, each pattern of the multimarker should measure 50 mm while the single marker should measure 120 mm.
You may change this restriction by editing the marker.dat
file and replacing all the 50.0 values by the new measure for the multimarker. For the
marker, you can edit the arvoxeleditor.c
file and change the defined PATTERN_WIDTH
with the value you want.
In order to launch ARVoxelEditor, you need to connect a camera to the computer and identify the device assigned to it. Then launch the program as:
./exec/arvoxeleditor [camera_identifier] [voxel_size]
where voxel_size
controls the size of the voxels and consequently
the resolution of the canvas; less size = more voxels you can place!
For example:
./exec/arvoxeleditor -dev=/dev/video1 16
If no arguments are provided, the application will try to open the first available camera and set a voxel size of 16 units.
First thing you have to do in order to start painting is to put the multimarker within the visual camera region. Once the multimarker is correctly detected, you can use the simple marker to paint as if it were a brush.
Controls are indicated within the application:
- Q: Quit
- -/+: Change colour (cycles the list of colours)
- R: Clean canvas (reset)
- U: Undo the last action (removes the last placed voxel)
- ENTER: Command line
- SPACEBAR: Put voxel
- X: Remove voxel
The command line allows the user to enter some commands. At the moment it just support the next:
save <path/filename.vox>
: Saves the current model to the given path.load <path/filename.vox>
: Loads the current model to the given path.
New commands can be easily added; look at the
input()
function for more
information.
Also, in command line mode the user can press the '^' key in order to insert the current working directory, for example, to access easily to the models directory.
VOX files are generated by the application when you saved a model. Every line in the file specifies a voxel location and its colour preceded by the 'v' character. Lines starting by any other character are ignored, for example, comments are inserted in the file with lines starting by a '#' character just for convenience.
Example.vox defining 4 voxels making a tower:
# +-----------------------------------------------------------+
# | Augmented Reality Voxel Model exported from ARVoxelEditor |
# +-----------------------------------------------------------+
# * Number of voxels: 4
# * Number of colours: 3
v 0 0 0 1
v 0 0 0 2
v 3 0 0 3
v 1 0 0 4
Models directory contains some voxel models you can load on the application. Also, some images are provided as preview. Note that the application UI may have changed since that images.
If you make some model, send it to me to insert it here or just make a pull request :)
ARVoxelEditor - Augmented Reality Voxel Editor Copyright (C) 2015 Santiago Sánchez Sobrino
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 2 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.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Full text can be found at the LICENSE file.