Marching Cubes result to indexed mesh issue ("Solved")

Started by
2 comments, last by lolobase 13 years, 9 months ago
Hello!

I have just implemented the "vanilla" Marching Cubes algorithm and now I want to make a nice indexed triangle mesh from the result. The algorithm that I implemented just outputs all the triangles separated without any point sharing and I really want to share points.


I see two possible ways out of this:

1. Use a general method for joining points with some spatial index perhaps. Somebody knows a good structure/method for this?

2. Use a smart indexing scheme for the edges when performing the Marching Cubes algorithm. I have thought about this but every solution I come up with seems to complicated. Has anyone done this and live to tell about it?


/Per

[Edited by - pernyblom on July 14, 2010 2:23:12 AM]
Advertisement
I went for solution 1 and preprocessed the triangles with a KD tree for checking duplicates/close points. It seems to scale up reasonably well but an index scheme would be much better.

Anyway, this issue can probably be considered solved. At least from my point of view :)
On a related note (I have marching cubes up and running also) I want to know if stream-out buffers are relocatable. That is, after generating the triangles for all the voxels in a chunk, can I write the stream out buffer to disk, load it back in later, and have DrawAuto() work with it?

(I suppose this is really a DirectX question)
I couldn't get DrawAuto() to work with a streamed in buffer (from disk) as I wanted, although since the buffer size is known at that point, I can draw the streamed in buffer triangles using regular Draw(fileSize/sizeof(gsOutput), 0).

This topic is closed to new replies.

Advertisement