3
$\begingroup$

So I am facing the following issue. Say I have a minecraft like mesh (i.e I have a bunch of cubes on top of one another).

I wish to smooth out this mesh in such a way that only the regions where there are edges are smoothed out and such that the smoothing concentrates around the edges (e.g if I have a staircase the overall shape of the cubes that make the staircase should still be close to the staircase but instead of having straight edges I should have something much smoother).

I should be able to smooth things out locally, so that if a block is removed from this mesh, I can run the subdivision algorithm only on the newly generated coarse region that is created after the block is removed.

Does anybody have any ideas as to which algorithm I could use?

$\endgroup$

1 Answer 1

1
$\begingroup$

If you have this data in a 3d array where a block is a 1 and no block is a 0 you can apply a 3d blur and then set all voxels that are left with a value higher than 0.5 to 1 and those that arent to 0. this will smooth out sharp details and leave flats mostly uneffected

$\endgroup$
4
  • $\begingroup$ I don't thing you understood what I was trying to do, I am basically trying to make the cubes themselves smooth, i.e instead of sharp cubes I should have a smooth cube like "sphere" $\endgroup$
    – Makogan
    Jan 12, 2018 at 19:01
  • $\begingroup$ ahh i see, i misunderstood $\endgroup$ Jan 12, 2018 at 19:46
  • 2
    $\begingroup$ you have finite and relatively small amount of ways that cubes can be arranged around a vertex. you could pregenerate meshes for all different configurations an replace each visible vertex with a mesh with the corresponding smooth shape... keep in mind that you will need C1 continuity so having those meshes align with the grid at their "endpoint" would be an easy way of doing it $\endgroup$ Jan 12, 2018 at 19:50
  • 1
    $\begingroup$ "you have finite and relatively small amount of ways that cubes can be arranged around a vertex" And they have already been compactly enumerated in the marching cubes algorithm :) $\endgroup$
    – user106
    Jan 13, 2018 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.