I've been experimenting with the voxel painter example found in the ThreeJS git repository.
One change I made was adjusting the grid size to 5x5, but now the roll-over mesh doesn't align perfectly with the grid squares and overlaps between four of them.
Additionally, I'm looking for a way to make it possible to adjust the grid size to various dimensions such as 5x10, 12x5, or 16x24. Does anyone have any suggestions on how to accomplish this?
Below is the code snippet I'm currently working with:
var sizeX = 300;
var sizeY = 300;
function init() {
// Code for setting up the roll-over mesh, cubes, and grid
}
function onDocumentMouseMove( event ) {
// Code for handling mouse movement and interaction with objects
}
Codepen: http://codepen.io/anon/pen/RPrxOX