2014-05-01から1ヶ月間の記事一覧

環境設定

カメラや光源の位置などを指定します。 //********************************************************************************** global_settings { assumed_gamma 2.2 max_trace_level 5 } camera { angle 50 location -200*z look_at 0 } light_source { …

16.ドア

CSGによりドアの形状を生成し、湖面上のドアの画像を、レンダリングします。

背景の描画

雲にカラフルな色を付けたような背景を sky_sphere により描画します。 //********************************************************************************** #local Ph=0.78; #local Cv1=; #local Cv2=; #local Cv3=; sky_sphere { pigment { bozo phas…

カクテルグラスの描画

背景の円盤とカクテルグラスを描画します。 //********************************************************************************** disc { z, 50.0 12.0 pigment { P_disc } } object { C_glass texture { T_glass } translate -36*y } //***************…

グラスの材質

ワイングラスの材質を指定します。 //********************************************************************************** #local Cv1=; #local Cv2=; #local Cv3=; #local T_glass = texture { pigment { ripples color_map { [ 0.0 rgbf ] [ 0.5 rgbf ]…

円盤の色

背景となる円盤の色を指定します。 //********************************************************************************** #local P_disc = pigment { gradient x+y color_map { [ 0.25 rgbf ] [ 0.25 rgbf ] [ 0.75 rgbf ] [ 0.75 rgbf ] } } //********…

カクテルグラスの形状

カクテルグラスの形状を滑らかな曲面により生成します。 //********************************************************************************** #local C_glass = Smooth_surface2(,,3) //*************************************************************…

曲面の式

カクテルグラスの形状を生成する曲面の式を登録します。 //********************************************************************************** #macro Surface_func(Su,Sv,Func_no) #switch(Func_no) #case( 3) #local Rp=0.8*(abs(pow(Sv,0.7)-1)+abs(p…

滑らかな曲面の描画マクロ

滑らかな曲面を生成するためのマクロです。 //********************************************************************************** #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 P=Surface_func(U,V,Fn); #local H=1e-4; #local Fu=Surface_func…

背景色の指定

背景の色を指定します。 //********************************************************************************** background { color rgb } //**********************************************************************************

環境設定

カメラや光源の位置などを指定します。 //********************************************************************************** global_settings { assumed_gamma 2.2 max_trace_level 5 } camera { angle 40 location -200*z look_at 0 } light_source { …

15.カクテルグラス

曲面の式を用いて、カクテルグラスをレンダリングします。

時計の描画

マクロ Clock_time を呼び出して、時刻を指定した時計を描画します。 //********************************************************************************** object { Clock_time() scale 1.2 rotate -45*x translate 30*y } //*************************…

針の色

時分秒の針の色を指定します。 //********************************************************************************** #local P_sec = pigment { color rgb } #local P_min = pigment { color rgb } #local P_hour = pigment { color rgb } //***********…

時計の材質

時計の材質を指定します。 //********************************************************************************** #local T_gold = texture { pigment { color } finish { metallic ambient 0.1 diffuse 0.4 reflection 0.25 specular 1 } } //**********…

時刻を指定した時計の描画マクロ

時分秒を指定した時計を描画するマクロです。 //********************************************************************************** #macro Clock_time(Hms) #local Hour=Hms.x; #local Min=Hms.y; #local Sec=Hms.z; union { object { Clockface textur…

時針の形状

時針の形状を定義します。 //********************************************************************************** #local Lh=78; #local Hour_hand = plane { y, 0 clipped_by { union { sphere { 0,2.5 scale } sphere { 0,7 } cone { 0,2.5, Lh*x,3 } c…

分針の形状

分針の形状を定義します。 //********************************************************************************** #local Lmin=105; #local Minute_hand = plane { y, 0 clipped_by { union { sphere { 0,2 scale } sphere { 0,5 } cone { 0,2, Lmin*x,2.…

秒針の形状

秒針の形状を定義します。 //********************************************************************************** #local Lsec=115; #local Sec_hand = plane { y, 0 clipped_by { union { sphere { 0,1.5 scale } sphere { 0,3 } cone { 0,1.5, Lsec*x,2…

時計の文字盤

文字盤の形状を定義します。 //********************************************************************************** #local Lw=1; #local Clockface = union { torus { 136,3*Lw/2 } #local Ei=12; #local Si=0; #while( Si cylinder { 130*x,136*x,3*Lw/…

組み合わせた歯車の形状

歯車を組み合わせた形状を定義します。 //********************************************************************************** #local Cm_x=-30; #local Cm_z=sqrt(pow(-45,2)-pow(Cm_x,2)); #local Cl_x= 35; #local Cl_z=sqrt(pow(-60,2)-pow(Cl_x,2))+…

小の歯車の形状

小さい歯車の形状を定義します。 //********************************************************************************** #local Lw=20; #local Cogwheel_s = union { difference { cylinder { 0,y,Lw } #local Ei=pi*Lw/2.6; #local Si=0; #while( Si sph…

中の歯車の形状

中の歯車の形状を定義します。 //********************************************************************************** #local Lw=40; #local Cogwheel_m = union { difference { cylinder { 0,y,Lw } #local Ei=pi*Lw/2.6; #local Si=0; #while( Si spher…

大の歯車の形状

大きい歯車の形状を定義します。 //********************************************************************************** #local Lw=60; #local Cogwheel_l = union { difference { cylinder { 0,y,Lw } #local Ei=pi*Lw/2.59; #local Si=0; #while( Si sp…

歯車の形状

歯車の形状を定義します。 //********************************************************************************** #local Lw=20; #local Cogwheel_a = union { difference { cylinder { 0,y,Lw } #local Ei=pi*Lw/2.6; #local Si=0; #while( Si sphere { …

背景色の指定

背景の色を指定します。 //********************************************************************************** background { color rgb } //**********************************************************************************

環境設定

カメラや光源の位置などを指定します。 //********************************************************************************** global_settings { assumed_gamma 2.2 max_trace_level 5 } camera { angle 52 location look_at 0 } light_source { color r…

14.時計

CSGにより、アナログ時計の画像を、レンダリングします。

柿の描画

二個の柿を描画します。 //********************************************************************************** object { Persimmon_obj rotate translate } object { Persimmon_obj rotate translate } plane { y,-24 pigment { P_floor } rotate } //**…