POV-Ray : Newsgroups : povray.binaries.images : WIP mini planet [81 Ko] : Re: WIP mini planet [81 Ko] Server Time
15 Nov 2024 10:18:28 EST (-0500)
  Re: WIP mini planet [81 Ko]  
From: JC (Exether)
Date: 17 Jul 2003 03:22:22
Message: <3F164EAA.7020505@spam.fr>
Ghost wrote:
> This is great! It looks more like hair or fur rather than grass.  But it
> -does- look like grass, too!  Say, how did you attach all that grass to the
> surface anyhow?  I presume you used trace(), but I'm awfully curious how to
> get it to conform to a sphere...
> -Lawrence
> 
> "JC (Exether)" wrote:
> 
> 
>>I'm planning to use this planet for a representation of "le petit
>>prince" which is a character of Saint Exupery a french writer.
>>
>>The planet is an isosurface, and grass a bunch of some 300000 cones.
>>
>>JC
>>
>>  ------------------------------------------------------------------------
>> [Image]
> 
> 

I first thought that having a uniform random repartition of points on a 
sphere was going to be difficult but I finally found an easy solution.
I take 3 random angles and I rotate my point around all 3 axes with 
these angles.

     #local a1=360*rand(MySeed);
     #local a2=360*rand(MySeed);
     #local a3=360*rand(MySeed);
     #local InitPos = vrotate (<10,0,0>, <a1,a2,a3>);
     #local Pos=trace (Terrain, 0, InitPos, Norm);

Then, I check if the altitude is above water level and I create the 
grass blade.

There might be more optimized solutions, but this one works.

JC


Post a reply to this message

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