空間曲面

latheにより回転面をレンダリングしました

回転面

手順 ① Box-Muller法により乱数から正規分布を発生させ

     平均値と標準偏差により 複数のxy座標を生成する

   ② xy座標をyの値により昇順にソートする

   ③ latheを用いてcubic_splineの座標としてソートしたデータを使用し

     レンダリングする

参考までにマクロを載せておきます

//**********************************************************************************
#macro Box_muller(Rnd,Mean,Stan)
 #local R1=rand(Rnd); #local R2=rand(Rnd);
 #local Rg=sqrt(-2*log(R1))*cos(2*pi*R2)+sqrt(-2*log(R1))*sin(2*pi*R2);
 Mean+Stan*Rg 
#end
//----------------------------------------------------------------------------------
#macro Sort2d(R2d)
 #local N=dimension_size(R2d,1); #local Ds=R2d;
 #local i=0; #while(i<N-1)
  #local j=i+1; #while(j<N)
   #if(Ds[i].y-Ds[j].y>0)
    #local Bck=Ds[i]; #local Ds[i]=Ds[j]; #local Ds[j]=Bck; #end 
  #local j=j+1; #end
 #local i=i+1; #end
 Ds
#end
//---------------------------------------------------------------------------------
#macro Sort_Lathe(Vtyp,R1,R2)
 #local Ctyp=asc(strupr(Vtyp))-(asc("A")-1);
 #local N=13; #local P=array[N];
 //
 #local i=0; #while(i<N)
  #local P[i]=<Box_muller(R1.x,R1.y,R1.z),Box_muller(R2.x,R2.y,R2.z)>;
 #local i=i+1; #end
 //
 #local P=Sort2d(P);
 //
 #local Lathe =lathe { cubic_spline N, #local i=0; #while(i<N) P[i] #local i=i+1; #end }
 #switch(Ctyp)
  #case(24) object { Lathe rotate -90*z } #break
  #case(25) object { Lathe } #break
  #case(26) object { Lathe rotate 90*x } #break
 #end
#end // macro end
//**********************************************************************************

#local Tc = texture { pigment { color rgb <0.417,1.205,1.472> }

            finish { phong 1 reflection 0.1 } }

#local Sc=2; #local Rt=45*z; #local Tr=-59*z; 
#local Tf=transform { scale Sc rotate Rt translate Tr }

object { Sort_Lathe("z",<seed(654321),20,6>,<seed(987654),20,21>)

                   texture { Tc } transform Tf }