POV-Ray : Newsgroups : povray.general : Star night sky : Re: Star night sky Server Time
8 Aug 2024 22:16:31 EDT (-0400)
  Re: Star night sky  
From: KalleK
Date: 28 Sep 2000 16:19:20
Message: <39d3a7c8@news.povray.org>
Hi Warp!
Just curios: Why the inner loop? I don't see a reason to keep the length of
Location below 1.
vlength(Location/vlenth(Location)) is always 1 isn't it?
Or is it already too late at night?
KK

Warp <war### [at] tagpovrayorg> wrote:
>   For example something like this:
>
> #declare Stars = 1000;
> #declare Distance = 1000;
> #declare StarRadius = 1;
> #declare Seed=seed(0);
>
> #local Ind=0;
> #while(Ind<Stars)
>   #local Location = <-1+rand(Seed)*2, -1+rand(Seed)*2, -1+rand(Seed)*2>;
>   #while(vlength(Location) > 1)
>     #local Location = <-1+rand(Seed)*2, -1+rand(Seed)*2, -1+rand(Seed)*2>;
>   #end
>   #local Location = Distance*Location/vlength(Location);
>   sphere { Location, StarRadius pigment { rgb 1 } finish { ambient 1 } }
>   #local Ind=Ind+1;
> #end


Post a reply to this message

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