Skip to content

Commit

Permalink
Animated .vox files work; release 0.0.10
Browse files Browse the repository at this point in the history
This probably closes #4 , unless there's something I'm missing.
  • Loading branch information
tommyettinger committed Apr 13, 2018
1 parent 0cb34ec commit 5427422
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
.vs/

# User-specific files
*.suo
Expand Down
6 changes: 6 additions & 0 deletions IsoVoxel/IsoVoxel.csproj
Expand Up @@ -74,6 +74,12 @@
<ItemGroup>
<EmbeddedResource Include="white.png" />
<None Include="App.config" />
<None Include="Red_Fish.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Red_Fish_Animated.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Tank.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
235 changes: 157 additions & 78 deletions IsoVoxel/PaletteDraw.cs

Large diffs are not rendered by default.

Binary file added IsoVoxel/Red_Fish.vox
Binary file not shown.
Binary file added IsoVoxel/Red_Fish_Animated.vox
Binary file not shown.
4 changes: 2 additions & 2 deletions IsoVoxel/VoxScaler.cs
Expand Up @@ -162,10 +162,10 @@ static void Main(string[] args)
Console.WriteLine("Processing file " + voxfile + " and will edit that same file.");
PaletteDraw.white = new Bitmap(imageStream);
BinaryReader bin = new BinaryReader(File.Open(voxfile, FileMode.Open));
MagicaVoxelData[] mvd = PaletteDraw.FromMagica(bin);
MagicaVoxelData[][] mvd = PaletteDraw.FromMagica(bin);
PaletteDraw.storeColorCubesFaces();
bin.Close();
WriteVOX(voxfile, Scale(mvd));
WriteVOX(voxfile, Scale(mvd[0]));

}
}
Expand Down
30 changes: 20 additions & 10 deletions README.md
Expand Up @@ -11,16 +11,20 @@ can be downloaded from this project's [Releases section](https://github.com/tomm

The simplest way to make a bunch of renders (at least on Windows) is to drag and drop a MagicaVoxel .vox file
onto `IsoVoxel.exe` in the File Explorer, which will make a new folder that shares a name with the .vox file.
There will be 44 images in that folder once the program finishes rendering in a few seconds. They will all use
"light" outlining, where there is an outline around the image's silhouette and between gaps in space inside the
image, but the color is not a cartoon-style black and is instead a darker version of the nearby voxel color.
There will be at least 44 images in that folder once the program finishes rendering in a few seconds. They will
all use "light" outlining, where there is an outline around the image's silhouette and between gaps in space
inside the image, but the color is not a cartoon-style black and is instead a darker version of the nearby voxel
color. You can drag and drop animated .vox files, which will produce multiple frames in the same folder. Frames
will have their file names end with "_00.png", "_01.png", and so on up to the maximum 24 frames with "_23.png".

MagicaVoxel saves its .vox files in the vox/ subfolder of the MagicaVoxel install directory. You should, of
course, have unzipped IsoVoxel.exe from the .zip it is distributed inside before running it.
MagicaVoxel saves its .vox files in the vox/ subfolder of the MagicaVoxel install directory.
You should, of course, have unzipped IsoVoxel.exe from the .zip it is distributed inside before running it.

Alternatively, you can customize the rendering somewhat from the command line. For this, use `IsoVoxel.exe file.vox x y z o`, where the arguments are:
Alternatively, you can customize the rendering somewhat from the command line.
For this, use `IsoVoxel.exe file.vox x y z o`, where the arguments are:
- file.vox was saved from MagicaVoxel, in the vox/ subfolder usually as mentioned before
- x, y, and z are the bounds of the model, which can be up to 128, and don't have to match the dimensions given in MagicaVoxel; this can be useful to render multiple models at the same position in the images
- x, y, and z are the bounds of the model, which can be up to 128, and don't have to match the dimensions given in MagicaVoxel;
this can be useful to render multiple models at the same position in the images
- o is an outline mode, which can be omitted and defaults to `outline=light`:
- `outline=full` (this makes black outlines around the edge of the model and shading on inner gaps)
- `outline=light` (which uses the shaded color instead of black for outer outlines)
Expand All @@ -31,15 +35,20 @@ Alternatively, you can customize the rendering somewhat from the command line. F
- if you don't include o it will use light outlining.
- o can be placed as the last argument even if some or all of x y z have not been included.

IsoVoxel will create a subdirectory named after the model (running on Truck.vox will create a folder called Truck, or on Zombie.vox will make a folder called Zombie) and fill it with 44 images:
IsoVoxel will create a subdirectory named after the model (running on Truck.vox will create a folder called Truck, or on
Zombie.vox will make a folder called Zombie) and fill it with 36 images:
- four for north/south/east/west
- four for the diagonals between them, rendered at a slightly different perspective (isometric)
- eight more for a mostly-top-down view of all eight directions, rendered at close to a 45 degree oblique angle as opposed to the "standard isometric pixel art" 26.565 degree angle; an advantage here is that all directions are about the same size and perspective
- eight images that are each double-sized versions of one of the original eight, with some extra voxels added to smooth jagged areas; these have Big in their name
- twelve images that are specially-smoothed versions of the N/S/E/W renders at 3 sizes, with Size1, Size2, or Size3 in the name
- four diagonal-direction (isometric) renders at the normal size but with sloped voxels used to make the hard edges seem softer
- four more diagonal-direction renders at a much smaller size, but still with sloped voxels; these may be harder to recognize if you have single-voxel details in the original models

If the .vox model is *not* animated, then 8 more renders will be produced:
- eight images that are each double-sized versions of one of the original eight, with some extra voxels added to smooth jagged areas; these have Big in their name
If the .vox model is animated (and has multiple frames), then the 36 images listed above will be rendered for each frame.

This comes with some .vox models to test on; Red_Fish_Animated.vox allows you to test the animation rendering.

IsoVoxel needs .NET 3.5 or higher (as of the time of writing, the current version available on Windows is at least 4.6), and has been confirmed at least once to work on Mono.

Results
Expand All @@ -63,3 +72,4 @@ Results
![Truck](http://i.imgur.com/7m3NETe.png)
![Truck](http://i.imgur.com/0f6jUdQ.png)
![Truck](http://i.imgur.com/Z6kjLN9.png)
![Red Fish](https://raw.githubusercontent.com/tommyettinger/IsoVoxel/master/RedFish.gif)
Binary file added RedFish.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5427422

Please sign in to comment.