POV-Ray : Newsgroups : povray.binaries.images : Just an experiment - 1 attachment Server Time
13 Aug 2024 07:25:54 EDT (-0400)
  Just an experiment - 1 attachment (Message 1 to 8 of 8)  
From: Zio Pera
Subject: Just an experiment - 1 attachment
Date: 7 May 2003 02:59:18
Message: <Xns93745B80D67BAfizbanlombardiacomit@204.213.191.226>
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'
explo.jpg


 

From: Hugo Asm
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 04:49:39
Message: <3eb8c8a3$1@news.povray.org>
> 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

From: Apache
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 04:53:32
Message: <3eb8c98c$1@news.povray.org>
Today let's try instulting: "hey, what's this yellow color? It looks
like....ehhh....yellow or something."

:)


Post a reply to this message

From: Zio Pera
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 05:29:17
Message: <Xns937474F507B53fizbanlombardiacomit@204.213.191.226>
"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

From: JC (Exether)
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 06:13:20
Message: <3EB8DCFA.1060600@club-internet.fr>
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

From: Hugo Asm
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 06:29:32
Message: <3eb8e00c$1@news.povray.org>
> 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

From: Zio Pera
Subject: Re: Just an experiment - 1 attachment - 2 attachments
Date: 7 May 2003 07:47:10
Message: <Xns93748C5166DE9fizbanlombardiacomit@204.213.191.226>
"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'
geo2x.jpg

Preview of image 'geo1x.jpg'
geo1x.jpg


 

From: Aaron Gillies
Subject: Re: Just an experiment - 1 attachment
Date: 7 May 2003 09:25:22
Message: <3eb90942$1@news.povray.org>
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

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