Hello, everybody!
The 3D scene consist of 20 objects based on polygonal model structure. I wanna convert polygonal objects to voxel data structure (i think it's array 3D map) . And voxel objects will be used for constructing distance field of all environment world.
Please, tell me, do you have any ideas about using c# structure class to store voxel data and be able for further using in code or any algorithms and methods?
Do you know any API or wrap that could realize this functionality?
Thanks.
Voxel structure programming implementation
Thinking about it brought me to one idea. You can use a zbuffer to voxelize your objects. With the size of this ZBuffer you can scale the density of your voxelgrid. Now render each object or the whole scene at origin from all six sides and stay at same distance from origin for each side with an orthogonal projectionmatrix. For every "side-rendering" you know x,y,z position for every pixel and can set visibility-flag for all voxels. If you also need color for a voxel use an additonal diffuse-buffer and save the color from same position.
No, man.
I don't need rendering voxelized object. I need structure of voxelizard object in program code, for exapmle, type - array of byte.
I don't need rendering voxelized object. I need structure of voxelizard object in program code, for exapmle, type - array of byte.
Thinking about it brought me to one idea. You can use a zbuffer to voxelize your objects. With the size of this ZBuffer you can scale the density of your voxelgrid. Now render each object or the whole scene at origin from all six sides and stay at same distance from origin for each side with an orthogonal projectionmatrix. For every "side-rendering" you know x,y,z position for every pixel and can set visibility-flag for all voxels. If you also need color for a voxel use an additonal diffuse-buffer and save the color from same position.
interesting idea !
Look up the Sparse Voxel Octree. It's probably the best way to squeeze voxel data down to a reasonable size.
What's your end goal of the project? What do you want to use the distance fields for?
What's your end goal of the project? What do you want to use the distance fields for?
DracoLacertae, thanks so. I'm planing to use distance field for definition distance between objects. It's very difficult to build distance field for Sparse Voxel Octree, 3D array is more better I think. If you have another mind about it, please, post me material reference.
Look up the Sparse Voxel Octree. It's probably the best way to squeeze voxel data down to a reasonable size.
What's your end goal of the project? What do you want to use the distance fields for?
Make sure your model has uv coordinates. Render your model to a texture. Set each vertex position to its vertex coordinates. Set each vertex color to its position. For each pixel, create a voxel at the position from pixel's color.
man, I don't catch what you have in mind! Could you show me class structure?
Make sure your model has uv coordinates. Render your model to a texture. Set each vertex position to its vertex coordinates. Set each vertex color to its position. For each pixel, create a voxel at the position from pixel's color.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement