POV-Ray : Newsgroups : povray.general : 2Q's: normal & random : Re: 2Q's: normal & random Server Time
12 Aug 2024 13:22:44 EDT (-0400)
  Re: 2Q's: normal & random  
From: Spider
Date: 8 Feb 1999 20:25:50
Message: <36BF8D5B.4F621019@bahnhof.se>
You can try :
#declaree s = seed(6666);
(log(rand(s))*60)-30
this may be what you want..

//Spider

ingo wrote:
> 
> Hi,
> I'm trying to make randomly curled paper sheets, I have two questions on
> this:
> 1. Although I don't need mutch detail I'd like to smooth the paper, so how
> to calculate the normals for smooth triangles?
> 2. How do I generate random numbers between -30 and +30, in such a way that
> there are mutch more between -15 and 15 than between -30 and 30?
> 
> ingo
> 
> #version 3.1;
> #include "colors.inc"
> global_settings{assumed_gamma 1.0}
> 
> light_source{
>   <500,500,-500>
>   color rgb 1
> }
> camera{
>     location<0.0,0.0,-2.5>
>     look_at<0.0,0.0,0.0>
> }
> //  #declare Rnd ......
> #declare A=vrotate(vaxis_rotate(<-0.25,0.25,
> 0>,<1,1,0>,Rnd)+<-0.25,0.25,0>,<Rnd,Rnd,0>);
> #declare B=vrotate(<0,0.5,0>,<Rnd,0,0>);
> #declare C=vrotate(vaxis_rotate(<0.25,0.25, 0>,<1,-1, 0>,Rnd)
> +<0.25,0.25,0>,<Rnd,Rnd,0>);
> #declare D=vrotate(<-0.5,0,0>,<0,Rnd,0>);
> #declare E=<0,0,0>;
> #declare F=vrotate(<0.5,0,0>,<0,Rnd,0>);
> #declare G=vrotate(vaxis_rotate(<-0.25,-0.25,0>,<-1,1,0>,Rnd)
> +<-0.25,-0.25,0>,<Rnd,Rnd,0>);
> #declare H=vrotate(<0,-0.5,0>,<Rnd,0,0>);
> #declare I=vrotate(vaxis_rotate(<0.25,-0.25,0>,<-1,-1,0>,Rnd)
> +<0.25,-0.25,0>,<Rnd,Rnd,0>);
> 
> mesh {
>   triangle {A,B,D}
>   triangle {D,B,E}
>   triangle {E,B,F}
>   triangle {B,C,F}
>   triangle {D,G,H}
>   triangle {D,H,E}
>   triangle {E,H,F}
>   triangle {H,I,F}
>   scale <1,2,1>
>   pigment {rgb 1}
> }
> 
> ---
> Thank, to the Muse with the glass eye.


Post a reply to this message

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