#Need help with basic marching cubes algorithm implementation
25 messages · Page 1 of 1 (latest)
this seems really simple and in my head i dont see a reason it should work
all im doing is taking values from 8 points from a voxel grid to form a cube, using those values to create a mesh accordant to a table of indices for each cube, and then marching to the next cube to do the process over
i have a basic noise heightmap that as you can see in the image (the image is visualizing the voxel points, not the cubes) will cut off about 25% of the way up the cube of voxels i created, and it has a little slope at the end too, which should work well for demonstration, but simply nothing appears
man i have no clue how to make these posts concise enough for people to actually read through and help while still capturing all the escential details
OK
MASSIVE UPDATE
BUT I HAVE COME UPON A NEW ISSUE
so
first things first
i ended up solving this
it seemed to be an issue with the way i was indexing my vertices after creation
they would be indexed like 4 times when only 3 were created
anyway
ive come upon a new issue a bit later into development
now that i can properly see the vertices im creating
i now have the issue of strange artifacts in my marching cubes mesh generation
not only are small single corner tris being generated in cases where it should index 255 (blank edge lookup) but it also has these odd holes in random surfaces
you can see that i have set up indicators here for every cube of 8 voxel points that has been marched in a chunk
and if you look closely...
youll notice that highlighted corner points are points that are active
however... these down here all appear to be active, how come they arent reaching 255?
here is my index generation code
i am printing this index after its creation, it is consistantly never printing a single 255