POV-Ray : Newsgroups : povray.binaries.images : I'll ask for help here, too : Re: I'll ask for help here, too Server Time
15 Aug 2024 02:31:50 EDT (-0400)
  Re: I'll ask for help here, too  
From: Tony LaVigne
Date: 14 Aug 2002 14:10:11
Message: <web.3d5a996d5e6d1328d97cd3e00@news.povray.org>
Timothy R. Cook wrote:
>Observe figure 1.  Randomly-filled-with-sphere_sweep
>cylinder.  Good.
>Observe figure 2.  Randomly-filled-along-xy-axes,-
>but-the-z-axis-isn't-random.
>I want figure 2 filled with the randomness of figure
>1.
>How do I do that?

If R_env= envelope you want to keep it in, then
the envelope depends on where Z is so

R_env = f(Z)
It looks like you described it as something like
R_env= (Z+1.2)^2

I would find Z first and then use it to find the envelope and then
find X and Y

Theta=rand(Seed)*360
Z=rand(Seed)
R_env = (Z+1.2)^2
R=R_env*rand(Seed)
X=R*cos(Theta)
Y=R*sin(Theta)


This is independant of your while loop (N variable)
There may be rare occurances where your line points may be within your
boundries, but the path of the line might cross back and forth.
Tony


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.