Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #171672

Re: random points near central point

From John Forkosh <forkosh@panix.com>
Newsgroups comp.lang.c
Subject Re: random points near central point
Date 2023-08-05 10:57 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <ual9ur$t6d$1@reader2.panix.com> (permalink)
References <eb9e82fb-265b-42a7-a245-1943e5b3b5aan@googlegroups.com>

Show all headers | View raw


fir <profesor.fir@gmail.com> wrote:
> i need to set asteroids in game (about 100 or 200) but not in square
> area with two rands one for x and second for y but need it to
> be sphericel symetric around central point and in more density near it
> and less desity with bigger radius until some radius when it is zero
> 
> something like 
> 
> SetRandomPointSphericalSymetricAndFadingWithDistance(
> float x, float y, float r1, float r2);
> 
> this r1 is radius of circle below which density is max and r2 is radius 
> where above density is zero - in beetweem r1 and r2 density should 
> be from max (at r1) to zero at r2
> 
> how to do that?

Haven't read the followups. You mean something like...
   https://www.deviantart.com/eigenheit22/art/Starfield-v1-860092004
...without the animation? That's done in x,y (and z). And you can then
just calculate r=sqrt(x*x+y*y) and discard the ones you don't like.
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

random points near central point fir <profesor.fir@gmail.com> - 2023-07-18 23:38 -0700
  Re: random points near central point Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-19 01:49 -0700
    Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-19 04:20 -0700
  Re: random points near central point Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-19 01:59 -0700
  Re: random points near central point Kaz Kylheku <864-117-4973@kylheku.com> - 2023-07-19 16:50 +0000
  Re: random points near central point Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-07-19 20:23 +0100
    Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-20 09:31 -0700
      Re: random points near central point Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-07-20 20:42 +0100
        Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-20 12:56 -0700
          Re: random points near central point Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-07-20 20:59 +0100
          Re: random points near central point David Brown <david.brown@hesbynett.no> - 2023-07-21 09:13 +0200
            Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-21 05:55 -0700
              Re: random points near central point Ed Prochak <edprochak@gmail.com> - 2023-07-22 12:24 -0700
                Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-23 04:04 -0700
                Re: random points near central point Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-07-23 14:53 +0100
                Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-23 07:03 -0700
                Re: random points near central point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-07-23 12:30 -0700
                Re: random points near central point Ed Prochak <edprochak@gmail.com> - 2023-07-30 21:48 -0700
                Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-03 10:00 -0700
        Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-20 13:20 -0700
      Re: random points near central point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-07-20 12:57 -0700
        Re: random points near central point fir <profesor.fir@gmail.com> - 2023-07-20 13:18 -0700
          Re: random points near central point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-07-23 12:28 -0700
  Re: random points near central point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-07-20 12:56 -0700
  Re: random points near central point Bonita Montero <Bonita.Montero@gmail.com> - 2023-08-03 19:17 +0200
    Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-03 10:55 -0700
      Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-03 11:04 -0700
      Re: random points near central point Bonita Montero <Bonita.Montero@gmail.com> - 2023-08-04 17:22 +0200
        Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-04 10:06 -0700
  Re: random points near central point John Forkosh <forkosh@panix.com> - 2023-08-05 10:57 +0000
    Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-05 05:41 -0700
      Re: random points near central point John Forkosh <forkosh@panix.com> - 2023-08-07 13:11 +0000
        Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-07 06:26 -0700
          Re: random points near central point fir <profesor.fir@gmail.com> - 2023-08-07 06:33 -0700
  Re: random points near central point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-08-06 11:57 -0700

csiph-web