isosurface { function { 0.5 * x*x + y*y + z*z - 1 } contained_by { box {-1, 1} } } |
camera { location <1.5, 0.5, -2.0> look_at <0.0, 0.0, 0.0> right x * image_width/image_height } light_source { <20, 40, -20> color rgb <1,1,1> } isosurface { function { 0.5 * x*x + y*y + z*z - 1 } contained_by { box {-1, 1} } max_gradient 3 texture { pigment { color rgb < 1, 0.8, 0.5 > } finish { ambient rgb <0.1, 0.1, 0.1> diffuse 0.9 specular 0.2 } } } |
#include "functions.inc"であらかじめ用意されている関数群をインクルードして、関数部分を
function { f_noise3d(x, y, z)-0.5 }とすることで、左のような図を表示できます。
function { 0.5-f_noise3d(x, y, z) }
#declare FUNC=function{ pattern { density_file df3 "sample.3df" interpolate 1 } } |
isosurface { function { 0.15 - FUNC(x,y,z) } ...省略... |
camera { location <1.1, -1.1, 1.2> look_at <0.0, 0.0, 0.0> sky <0, 0, 1> right x * image_width/image_height } light_source { <20, -40, 120> color rgb <1,1,1> } #declare FUNC=function{ pattern { density_file df3 "sample.3df" interpolate 1 } } isosurface { function { 0.15 - FUNC(x,y,z) } contained_by { box {0, 1} } max_gradient 3 accuracy 0.0003 texture { ...省略... } translate < -0.5, -0.5, -0.5 > scale <2, 2, 0.5> } |
#declare FUNC=function{ pattern { density_file df3 "sample.3df" interpolate 1 scale <1.01, 1.01, 1.03> } } | 約1メッシュ分拡大 |