Is it possible to use C++'s poisson_distribution to sample 3D points within an axis- aligned cube?

I don’t understand what you are trying to do.

Are you using a random number generator with a poisson distribution to pick points off an OpenGL cube?

Or are you plotting points within that cube?

[QUOTE=wmelgaard;1279614]I don’t understand what you are trying to do.

Are you using a random number generator with a poisson distribution to pick points off an OpenGL cube?

Or are you plotting points within that cube?[/QUOTE]

I am plotting points within that cube.

Assume that your box is bounded by [0,0,0; 0,0,1; 0,1,0; 0,1,1; 1,0,1; 1,1,1]. Compute your point [x,y,z] where (0 <= x <= 1); (0 <= y <= 1); (0 <= z <= 1) and plot your point within your cube.

glBegin(GL_POINTS);

glVertex3f(x, y, z);

glEnd();

repeat as required. You may need to increase your point size, since the default is one pixel, which is almost invisible.

Problem (as presented) is complete. However, viewing the result is a major problem, since your window is in 2D. One solution is to vary the color. E.g.

glColor3f(x, y, z);

Another solution is to wiggle your plotted cube, which would give an illusion of depth.

Another solution would be to vary the plotted point size with depth, with the largest points being the closest. The greater your hardware resolution, the more effective this will be.

Of course if you have a 3D monitor, the problem goes away. (smiley face).