List of voxels. Struggle to display.

Hi to all,

I did a C++ program performing calculations to get a huge list of voxels (3D pixels). My voxels are objects with parameters describing their first corner position in space (x1,y1,z1) and a side measure.

Now, I want to display these cubes(voxels) in a 3D cartesian plan using glut.

I tried to use the glutSolidCube(dim) function to generate each voxel by looping in my list but it doesn’t work. I tried to place this loop inside the usual, as presented in tutorials, Display function. I feel I’m trying to force an unorthodox method of doing…

Can you point me an example, a reference site or explain the concepts usually used to proceed in such cases. I dont know where to check anymore. I just want to hack my way and then refine my prog.

Thanks in advance,


I tried to use the glutSolidCube(dim) function to generate each voxel by looping in my list but it doesn’t work.

Well it should be fine.
What does not work ? You see nothing, or garbage ?

Then after that there are ways to improve performance, depending on what geometry is dynamic, and what is fixed.

Nah… Its weird.

I moved files around and my project was not linked with glut32.lib.

Now, the compilation proceeds over the Display() but I then have an error with:

undefined reference to ‘glEnable@4’

for the line that corresponds to the glEnable(GL_CULL_FACE) function call. I checked on the internet and it is still a linking error. I’ll do my best.

bye the way, thanks for the quick answer.

Make sure that you’re linking with the regular OpenGL libraries, like OPENGL.DLL or GL.DLL (I don’t actually know what it is on Windows, but it’s something like that). That library should define glEnable.


First, thanks to all of you for taking the time to answer my questions.

I fix the compilation issue by going with Visual Studio instead of Codeblocks. It’s sad, cause I prefer CB.

Anyway, I continue my learning of OpenGl with the SuperBible cause my program is just freezing. My list is huge, something like 10^6 entries… and I know my use of the API is just bad. I’m closer by using double buffering, but I think I really need to fill a data structure, which I don’t know yet, and then draw. I’ll give you news once I find my trail.


I don’t know if this is what you’re looking for but you might have a go with display lists…