Jun 29, 2014 at 6:28 PM
Edited Jun 29, 2014 at 7:15 PM
In an earlier post I asked about recolouring the sides of a medkit I was working on. Another user gave me a solution and it worked in that case. (Creating the other side seperately, then using pattern to add them to the medkit)
A major problem is when the voxel object is made by importing a 3D model, such as this barrel I imported from an OBJ file.
The object is imported as all one single colour. I can not use the object as it is in my game. I would have to recolour it, but there are thousands of voxels on the surface of the barrel, and repainting them all manually would take an absurdly long time.
Second example (fictional):
Let's say I want to create a voxel version of the moon and I have a photo of the full moon.
At present it seems there are only a couple of options for making my voxel moon. I can either import a sphere and manually paint every voxel to match the photo (which would take a tediously long time), or I could import the photo and extrude to full depth,
then manually erase all extra voxels in the squared off block until I have turned it into a sphere (which would also take a tediously long time).
Neither of these are good solutions.
Here is my (hopefully) simple solution:
Create the option to project an image onto the voxel object
First, the user is asked for the filename of the image, and the image is loaded in.
Second, the user would be asked which of six possible directions (Front, Back, Left, Right, Top, or Bottom) he wishes to apply the image.
Third, a popup window showing the voxel object in a flattened version without perspective
allows the user to align the image with the voxel object.
The graphics below are a 2D representation of the (hopefully) simple process. The mass of squares represents the voxels in a solid object. The coloured bars represent the individual pixels in the image. In the example the image is being projected from the front.
Each voxel closest to the front
takes on the colour of the pixel it is aligned with in the image.
This leaves the front side of the object coloured to match the image.
If the image is smaller than the object, then voxels outside the bounds of the image would be unchanged.
If there are any transparent pixels in the image, then the voxels aligned with the transparent pixels will remain unchanged.
The user would be responsible for properly scaling the image and making sure it is using the correct palette.