POV-Ray : Newsgroups : povray.advanced-users : Random rotation don't work ? : Re: Random rotation don't work ? Server Time
29 Jul 2024 14:11:42 EDT (-0400)
  Re: Random rotation don't work ?  
From: Chris Becker
Date: 6 Mar 2002 17:22:34
Message: <3c8696aa@news.povray.org>
rand produces numbers between 0 and 1 so you are basically rotating between
0 and 1 degree.

Try this:
rotate<rand(R1)*360, rand(R1)*360, rand(R1)*360>

"_Light_Beam_" <fac### [at] aolcom> wrote in message
news:3c860998@news.povray.org...
> I'm trying to make random rotation of random placed box.... the random
> fonction works with" translate" but rotate doesn't seem to work... why ?
> The code :
>
> // Essai sur les macros...
>
> #declare kub = box {<-0.1, -0.1, -0.1><0.1, 0.1, 0.1>
>          texture {
>                  pigment {color rgb <0.5, 0.0, 0.5>}
>                  finish {ambient 0.3
>                          diffuse 0.5
>                          reflection {0.0, 1 fresnel on}}
>                  }
>          }
>
> light_source {
>              <10, 5, -10>
>              color rgb 1
>              }
>

> #declare R1 = seed(360);
> // 1 unit random moving
> #declare R3 = seed(1);
>
> #declare i = 0;
>  #while (i < 2001)
>   object {kub translate <rand(R3), rand(R3), rand(R3)> rotate <rand(R1),
> rand(R1), rand(R1)>}
>  #declare i = i + 1;
> #end
>
> camera {
>        location <3, 0, 0>
>        look_at <0, 0, 0>
>        }
>
>
>


Post a reply to this message

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