Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Engineering project
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=394
Page 1 of 1

Author:  nh961 [ Thu May 24, 2012 12:07 pm ]
Post subject:  Engineering project

Hello,

I am developing a project based on voxel rendering. I would like to use your library but I don't understand how to do what I want to do.
Indeed, the voxels I receive (in a .ply file) have the RGBA information coded in 32 bits (as it is showed here http://www.pcl-users.org/PCD-file-forma ... 85215.html ).
I saw in the examples you made that the voxels are coded in 4 bits for the rgb color and 4 bits for the density.
Do you know how can I change this to use the 32 bits of RGBA data?

Furthermore,
I saw that you meshed the 3D model before rendering it. Is it possible to render it just with voxels (without meshes) ?

I am really sorry to bother you but I am novice in this field and my project depends on me :s

Have a nice day

Author:  Freakazo [ Thu May 24, 2012 12:35 pm ]
Post subject:  Re: Engineering project

The purpose of the PolyVox library, as I understand it, is to create meshes from voxel data. The 4bits of RGB you talk about is actually an ID for a materiel, so that the renderer can render the correct texture on the mesh generated from the voxel values.

I think what you are after is a Voxel renderer.

[edit] The reason for this is that rendering voxels directly isn't suitable for real time applications, I have however seen, and played, some Sparse Voxel Octree games, not sure how they are implemented though, have a look at Wolfenstein 3D.

If your application needs to be real-time, I suggest you have a look and see if the marching Cubes algorithm is suitable for your needs and if you can get away with generating a mesh instead of rendering the voxels directly.

Author:  ker [ Thu May 24, 2012 2:59 pm ]
Post subject:  Re: Engineering project

Actually it is no problem to encode rgba data in a volume.
The real problem is as it has already been noted, that polyvox is used for generating meshes from that volume instead of rendering it.

If you do not need real time rendering, you can use a polyvox volume and the polyvox raycast class to render each pixel on its own.

an example for storing rgba data in a volume:

Code:
struct MyRGBA
{
uint8_t r,g,b,a;
};
int xsize = 10;
int ysize = 10;
int zsize = 10;
PolyVox::Region reg(PolyVox::Vector3DInt32(0, 0, 0), PolyVox::Vector3DInt32(xsize, ysize, zsize));
PolyVox::SimpleVolume<MyRGBA> volume(reg);
volume.SetVoxelAt(3, 5, 1, {255, 0, 0, 0}); // set the voxel at position 3, 5, 1 to red

Author:  David Williams [ Fri May 25, 2012 10:03 am ]
Post subject:  Re: Engineering project

There is a further problem, which is that I don't believe you are actually dealing with voxel data here. The file to which you linked actually appears to describe point cloud data. The difference is that point cloud data explicitly specifies a list of point positions and the associated colour, where as voxel data does not store the position explicitly. Furthermore voxels are constrained to integer positions where as point cloud data can have floating point positions.

If this is confusing, think about it in 2D. A traditional .bmp does not store the positions and colour of each pixel. Instead it just stores a list of colours, and the software can work out whch colour goes where because it know how big the image is. This is similar to voxel data. On the other hand, if you had a list of 2D points with (floating point) positions and colours then this would be more like point cloud data.

It is possible to convert between the two but it's probably not what you want to do (depends on your application...). Instead you should probably just render each point as if it were a particle in a standart particle system. Perhaps the PCL library provides some features for this?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/