|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi all,
I was experimenting about circa-even distribution of objects around a
sphere, and that's whats gone out.
Comments, insults.... ?
Post a reply to this message
Attachments:
Download 'explo.jpg' (83 KB)
Preview of image 'explo.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Comments, insults.... ?
No insults. :o) But how do you compute the almost-even distribution,
perhaps by subdividing a triangle? If you share your code .. hmm.. I'll be
grateful but it's up to you.. Now you could add some media, or maybe you
already did.
Regards,
Hugo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Today let's try instulting: "hey, what's this yellow color? It looks
like....ehhh....yellow or something."
:)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Hugo Asm" <hua### [at] post3teledk> wrote in
news:3eb8c8a3$1@news.povray.org:
>
> No insults. :o) But how do you compute the almost-even distribution,
> perhaps by subdividing a triangle? If you share your code .. hmm..
> I'll be grateful but it's up to you.. Now you could add some media, or
> maybe you already did.
>
> Regards,
> Hugo
>
>
I just make 2 cycle, the outer scans the "meridians" of the sphere with a
fixed step, the inner scans the "parallels" (is the right word ?), with a
step that depends on the size of the parallel itself. Here is a snippet
of the code.
#declare fori = object { union {
#declare zi=0;
#while (zi<180)
#declare zrad=sin(zi*pi/180);
#if (zrad=0)
#declare xstep=360;
#else
#declare xstep=360/(30*zrad);
#end
//#declare xstep=int(xstep/5)*5;
#debug str(xstep,5,2)
#debug "\n"
#declare xi=rand(rr)*xstep;
#while (xi<360)
cylinder { <0.9*sin(zi*pi/180),0.9*cos(zi*pi/180),0>
<1.1*sin(zi*pi/180),1.1*cos(zi*pi/180),0>,
0.05 rotate <0,xi,0> }
#declare xi=xi+xstep;
#end
#declare zi=zi+10;
#end
} }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
The image looks nice.
But unfortunately I don't think you can do a real even distribution by
putting your holes on parallels and meridians. Actually even
distribution of points on a sphere is not an easy task at all. But you
can get a good approximation by using a electrostatic repulsion-like
algorithm starting with a more or less random distribution and step by
step moving them to be at even distances. But it costs CPU, it's more
complex and inelegant (it's an approx), so ...
Cordialement,
JC
Zio Pera wrote:
> "Hugo Asm" <hua### [at] post3teledk> wrote in
> news:3eb8c8a3$1@news.povray.org:
>
>
>>No insults. :o) But how do you compute the almost-even distribution,
>>perhaps by subdividing a triangle? If you share your code .. hmm..
>>I'll be grateful but it's up to you.. Now you could add some media, or
>>maybe you already did.
>>
>>Regards,
>>Hugo
>>
>>
>
> I just make 2 cycle, the outer scans the "meridians" of the sphere with a
> fixed step, the inner scans the "parallels" (is the right word ?), with a
> step that depends on the size of the parallel itself. Here is a snippet
> of the code.
>
> #declare fori = object { union {
> #declare zi=0;
> #while (zi<180)
>
> #declare zrad=sin(zi*pi/180);
>
> #if (zrad=0)
> #declare xstep=360;
> #else
> #declare xstep=360/(30*zrad);
> #end
> //#declare xstep=int(xstep/5)*5;
> #debug str(xstep,5,2)
> #debug "\n"
> #declare xi=rand(rr)*xstep;
> #while (xi<360)
> cylinder { <0.9*sin(zi*pi/180),0.9*cos(zi*pi/180),0>
> <1.1*sin(zi*pi/180),1.1*cos(zi*pi/180),0>,
> 0.05 rotate <0,xi,0> }
> #declare xi=xi+xstep;
> #end
> #declare zi=zi+10;
> #end
> } }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Here is a snippet of the code.
Thanks! I never thought of this solution. It seems good enough and simple.
I've tried to code a sphere by subdividing a triangle but couldn't get it to
work on the 3d dimension.
Regards,
Hugo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"JC (Exether)" <exe### [at] club-internetfr> wrote in
news:3EB### [at] club-internetfr:
> The image looks nice.
> But unfortunately I don't think you can do a real even distribution by
> putting your holes on parallels and meridians. Actually even
> distribution of points on a sphere is not an easy task at all. But you
> can get a good approximation by using a electrostatic repulsion-like
> algorithm starting with a more or less random distribution and step by
> step moving them to be at even distances. But it costs CPU, it's more
> complex and inelegant (it's an approx), so ...
>
> Cordialement,
>
> JC
I've already done this ;)
You can see the results in my previous posting (Subj: placing point on a
sphere, date Feb 18 2003) or here in small res attachments. The point are
calculated by an iterative C program, using a electrostatic repulsion
algorithm. You can also have the code, I've posted it on
povray.binaries.utilities
This attempt on parallels and meridians is simpler, and done using only
SDL, so can be used when a real even distribution is not needed.
While I write, I'm trying to do an animation of the image, rotating the
sphere along the Y axis... If it's worth, I'll post on p.b.a
Post a reply to this message
Attachments:
Download 'geo2x.jpg' (11 KB)
Download 'geo1x.jpg' (24 KB)
Preview of image 'geo2x.jpg'
Preview of image 'geo1x.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nice technique ... and if it is not CPU-intensive, a good
substitute for a more accurate distribution scheme.
Insults? On this mailing list? Never ...
Aaron
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|