It is currently Sat Aug 22, 2020 1:44 pm


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Engineering project
PostPosted: Thu May 24, 2012 12:07 pm 

Joined: Thu May 24, 2012 7:43 am
Posts: 1
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


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Engineering project
PostPosted: Thu May 24, 2012 12:35 pm 

Joined: Sat Dec 18, 2010 2:58 am
Posts: 41
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Engineering project
PostPosted: Thu May 24, 2012 2:59 pm 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
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


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Engineering project
PostPosted: Fri May 25, 2012 10:03 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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?


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net