I’m trying to randomly and uniformly generate points on a cube surface in processing. I’m trying to make an animation so I’d need the x, y and z final position of the points.
Any suggestions? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just combine three uniform random distributions. This method assumes you have a unit cube [0..1]^3. If that is not the case, just scale and offset the points after you generate them.
Here’s some C++-ish pseudocode:
If you have a more general box instead of a cube, you have to bias the side-picking according to the areas of the box sides.