javascript - Threejs create optimized mesh from 2d array -


what want achieve creating voxel environment, 2d array holds positions blocks.

currently i'm doing using basic cube geometry, it's slow, , has unnecessary faces on sides of of cubes, , bottoms.

how can generate optimized mesh? i'm assuming detect neighbors , decide faces generate there.

my data irregular shape, looks this: enter image description here

the white areas there should mesh, , black areas there shouldn't anything. (i have converted 2d array of points)

i'm bit lost on how go doing this. looked @ http://threejs.org/examples/#webgl_geometry_minecraft thats generating square world, not 1 holes , stuff in it.

so how go doing this? there code guys possibly post me out?

any appreciated :)


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -