drwbns wrote:
I was talking about converting the terrain into a polyvox volume, then modifying and redisplaying as a manualObject.
This probably isn't the best approach. When working with PolyVox you probably don't want to use the Ogre terrain system. Even if you do use it (and this would be an advanced application) you would use is a destination for PolyVox meshes rather than as a source for PolyVox volume data.
Instead, I assume your Ogre terrain is builng generated from a heightmap? It is quite straightforward to convert a heightmap into a volume, then you can the the surface extractors to build the mesh and pass that to Ogre ManualObject. In this way you are bypassing the ogre terrain system completely.
To convert your heightmap to a volume, consider that you have a 1024x1024 input image, with grey scale values between 0-255. You could convert this to a 1024x256x1024 volume. Iterate over all the voxels in the volume and, for any given voxel at (x,y,z) look at the corresponding pixel (x,z) in the heightmap. The value in the heightmap is the height of the terrain, so if y is less that the heightmap value then this voxel should be set to be solid. Otherwise os should be empty space.
This code will probably not compile but it illustrates the idea. You can focus on the main function.