Hi!
It didn't took me very long to get there.
Your library isn't very hard to understand.
Fill a volume, extract a mesh, give the vertices/etc to DX and render everything. Just one thing I noticed:
The Volume::setVoxel (Or so, can't see my code yet) function could check, if the Voxels location is smaller than 0 or bigger than the volume size. Otherwise it crashes. And it is very uncomfortable to write that code, just every time I want to place a Voxel. It's just a small suggestion.
David Williams wrote:
Great, I'm glad you got it working. I don't have the source code in front of me, but as I recall an extracted mesh will always start at (0,0,0) and finish at the size of the region. For example, if the minimum of the region is (128, 128, 128) and the maximum is (192,192,192), then the extracted mesh will go from (0,0,0) to (64,64,64). There might also be a scaling factor of two somewhere but I think I took this out.
For now I was extracting the data just from 0,0,0 to X,X,X. So they always where at the origin (Or pivot <- I read this somewhere). Would be great if you could look that thing with the scaling up
Quote:
The remaining offset is stored somewhere in the SurfaceMsh I think (in the exampl above this would be (128, 128, 128). The reason it is done this way is I imagined the SurfaceMesh data would be placed into a node in a scenegraph, and that the offset would be used as the node's translation. I might think about this again though, maybe it is just confusing.
Yes, I'd like to handle this myself. The origin with the editor-widget would be somewhere else then, and this is not good. Whats with a bool-property in the extract-function? You could set the standard to what it was before, and no old code would break.
Quote:
I'm sorry, I don't know what you mean by the 'pivot'... I'm guessing you mean the origin (0,0,0)? I don't think the smoothing function changes anything else but I'll have to check the code later on.
The only thing I know, is that it makes my intersect-function working wrong.
The more I smooth, the smaller the region I can select gets. Is there any function (Except the sumNormals function) that simply recalculates the normals? This could might help. Otherwise, what code do you use to intersect your meshes? When it works fine there, could you give it to me?
Quote:
Anyway, I'm curious about where you got your data from? It looks funky
Is it procedurally generated?
Its a 64^3 volume with a start plane at the bottom of it. I implemented a function which makes a cube pop up where you clicked. I just had some fun!