POV-Ray : Newsgroups : povray.advanced-users : Random starfield? : Re: Random starfield? Server Time
28 Sep 2024 18:54:38 EDT (-0400)
  Re: Random starfield?  
From: Warp
Date: 3 Oct 2010 03:48:13
Message: <4ca8353d@news.povray.org>
W0RLDBUILDER <nomail@nomail> wrote:
> > #macro CreateStars(StarObject, Amount, Seed)
> >   #local MinExtent = <-100, -100, -100>;
> >   #local MaxExtent = <100, 100, 100>; // Modify as desired
> >
> >   #local Index = 0;
> >   #while(Index < Amount)
> >     object
> >     { StarObject
> >       #declare RandVector = <rand(Seed), rand(Seed), rand(Seed)>;
> >       translate MinExtent + (MaxExtent - MinExtent) * RandVector
> >     }
> >     #local Index = Index + 1;
> >   #end
> > #end
> >
> > #declare Seed = seed(0);
> > CreateStars(Star1, 100, Seed)
> > CreateStars(Star2, 100, Seed)
> > CreateStars(Star3, 100, Seed)
> >
> > --
> >                                                           - Warp

> I can't get that to work. I know I'm doing something wrong here. It's probably
> not a good idea to drop a macro on top of a semi-n00bish casual user who just
> wants to place some random stars. :-P

  Obviously you have to #declare Star1, Star2 and Star3 to be your desired
star objects because the CreateStar() lines.

-- 
                                                          - Warp


Post a reply to this message

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