2014-02-01から1ヶ月間の記事一覧
トーラスを切り取ることにより、りんごの一部となる茎の形状を生成します。 //********************************************************************************** #local Tr=60; #local Lw=1; #local Sr=180; #local Er=166; #local Ox=Tr; #local Oz=0;…
滑らかな曲面を描画するマクロです。 //********************************************************************************** #macro Smooth_surface2(V1,V2,Fn) mesh { #local V=V2.x; #while( V #local U=V1.x; #while( U #local N=Nvector(U, V, Fn); #…
曲面の位置と外向きの法線ベクトルを得るマクロです。 //********************************************************************************** #macro Nvector(U,V,Fn) #local N=array[2] #local H=1e-4; #local P=Surface_function(U,V,Fn); #local Fu=Su…
りんごの形状となる曲面の式を、#case文の1に登録します。 //********************************************************************************** #macro Surface_function(U,V,Func_no) #switch(Func_no) #case(1) #local Rr=6*pow(V,1.05); #local F=R…
背景の色をRGBにより指定します。 //********************************************************************************** background { color rgb } //**********************************************************************************
レンダリングの環境を設定します。 //********************************************************************************** global_settings { assumed_gamma 2.2 max_trace_level 5 } camera { angle 40 location -200*z look_at 0 } light_source { colo…
曲面の式を用いて、りんごをレンダリングします。
レモンの大きさや向きなどを指定して描画します。 //********************************************************************************** object { Lemon_obj texture { T_lemon } scale *8 rotate 90*z translate -100*z } //**************************…
レモンの材質を指定します。 //********************************************************************************** #local Cv1=; #local Cv2=; #local T_lemon = texture { pigment { ripples color_map { [ 0.00 color rgb Cv2 ] [ 0.01 color rgb Cv1 …
曲面の式からレモンの形状を生成します。 //********************************************************************************** #local Lemon_obj = object { Curved_surface4(pi*,pi*,8) } //********************************************************…
式から曲面を描画するマクロです。 //********************************************************************************** #macro Curved_surface4(Up,Vp,Func_no) mesh { #local Vs=Vp.x; #local Ve=Vp.y; #local Va=Vp.z; #while( Vs #local Us=Up.x; #…
レモンとなる曲面の式を #case文の8に登録します。 //********************************************************************************** #macro Surface_function(Ut,Vt,Func_no) #switch(Func_no) #case(8) #local Rr=max(3*0.85,3*abs(cos(Vt))); #l…
背景の色を background により指定します。 //********************************************************************************** background { color rgb } //**********************************************************************************
カメラの方向や光源の位置などを設定します。 //********************************************************************************** camera { angle 40 location -200*z look_at 0 } light_source { color rgb 0.5 } light_source { color rgb 0.5 } lig…
曲面の式を用いて、レモンをレンダリングします。
傘と床を描画します。 //********************************************************************************** plane { y,-100 texture { T_flor } rotate } object { Unbrella scale 100 rotate translate } //*****************************************…
CSGにより傘の部分形状を結合して、傘の形状を生成します。 //********************************************************************************** #local Unbrella = union { object { Cloth } object { Shaft } object { Handl } object { Rib } obj…
傘の受骨の形状を、cylinder を用いてCSGの結合により生成します。 //********************************************************************************** #local Stretcher = union { cylinder { 0.10*z, -0.03*z, Wr*1.1 } cylinder { 0.01*z, -0.01…
傘の親骨の形状をCSGの結合により生成します。 //********************************************************************************** #local Rib_seg = union { torus { 1, Wr/5 clipped_by { plane { z, 0 translate -0.63*z } } } cylinder { 0*z, …
傘の手元の形状をCSGの結合により生成します。 //********************************************************************************** #local Tr=1/15; #local Handl = union { cylinder { (Stp-1/5)*z Stp*z Wr } torus { Tr, Wr rotate 90*z clipped…
傘の中棒の形状をCSGの結合により生成します。 //********************************************************************************** #local Wr=1/40; #local Stp=1/10; #local Shaft = union { cone { -1.1*z, 1/80, -1*z, Wr } cylinder { -1*z (St…
傘布の形状をCSGの difference により生成します。 //********************************************************************************** #local Tz=-0.4; #local Ty=sqrt(1-pow(0,2)-pow(Tz,2)); #local Top_seg = sphere { 0,1 clipped_by { plane …
傘布の色を color_map により指定します。 //********************************************************************************** #local P_map = pigment { gradient x+y color_map { [ 0.25 rgb ] [ 0.25 rgb ] [ 0.75 rgb ] [ 0.75 rgb ] } scale 1/10…
床の材質を texture により指定します。 //********************************************************************************** #local T_flor = texture { pigment { rgb } finish { ambient 0.35 diffuse 0.5 brilliance 15 phong 0.41 phong_size 5 } }…
背景の色を background により指定します。 //********************************************************************************** background { color rgb } //**********************************************************************************
レンダリングの環境を設定します。 //********************************************************************************** global_settings { assumed_gamma 2.2 max_trace_level 5 } camera { location look_at 0 angle 50 } light_source{ color rgb 1 …
傘の形状をCSGにより生成しレンダリングします。
椅子と床の描画をします。 //********************************************************************************** union { plane { y,0 pigment { Pc } translate (-Us*Ls+2)*y } object { Long_seg clipped_by { plane { -y,0 } translate (-Us*Ls+2)*y …