Skip to content

Does this require padding added to the voxel data?  #7

@kevzettler

Description

@kevzettler

I belive this is the same issue as #6

I have a source voxel struture.
screenshot 2017-03-21 13 55 23

When I import it with ao-mesher and ao-shader I get
screenshot 2017-03-21 13 56 14

If I pad the voxel ndarray with:

function paddVoxelNDarray(ndvoxels){
  var resolution = ndvoxels.shape;
  var padding = resolution.map(function (r) { return r + 4; });
  var voxelsWithPadding = zeros(padding, 'int32');

  var x, y, z;

  for (x = 0; x < resolution[0]; x++) {
    for (y = 0; y < resolution[1]; y++) {
      for (z = 0; z < resolution[2]; z++) {
        var v = ndvoxels.get(x, y, z);
        v = v ? (1 << 15 | v) : 0;
        voxelsWithPadding.set(x + 1, y + 1, z + 1, v);
      }
    }
  }

  return voxelsWithPadding;
}

It renders as expected:

screenshot 2017-03-21 13 55 33

Should I PR the padding to be include in this module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions