Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: 3D Poisson distribution

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2015
    Posts
    6

    3D Poisson distribution

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

  2. #2
    Intern Newbie
    Join Date
    Nov 2013
    Posts
    41
    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?

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2015
    Posts
    6
    Quote Originally Posted by wmelgaard View Post
    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?
    I am plotting points within that cube.

  4. #4
    Intern Newbie
    Join Date
    Nov 2013
    Posts
    41
    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).

    Quote Originally Posted by alexxi View Post
    I am plotting points within that cube.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •