User:Wfpokorny/DensityFile/Bowl

From POV-Wiki
< User:Wfpokorny‎ | DensityFile
Revision as of 18:46, 4 January 2018 by Wfpokorny (talk | contribs) (Changed 3.7.1 reference to 3.8.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Density_file as isosurace lathe where base df3 created from array of strings.

Df3 is created on the fly and represents the bowl profile to be rotated about y. Image on the left is the raw df3 as created via Fnct02a. Image on the right is of the bowl via Fnct02b.

The scene file in total is:

#version 3.8;
global_settings {
    assumed_gamma 1
    ambient_light srgb <1,1,1>
    noise_generator 3
}

#include "arrays.inc"           // For ARRAYS_WriteDF3()
#include "arraycoupleddf3s.inc" // Array coupled df3 macros & functions.

#declare AryStrs  = array[25][1]
#declare AryStrs[0][0]  = "-------------------------------------2------------";
#declare AryStrs[1][0]  = "------------------------------------3-------------";
#declare AryStrs[2][0]  = "-----------------------------------2--------------";
#declare AryStrs[3][0]  = "----------------------------------2---------------";
#declare AryStrs[4][0]  = "---------------------------------2----------------";
#declare AryStrs[5][0]  = "--------------------------------3-----------------";
#declare AryStrs[6][0]  = "-------------------------------4------------------";
#declare AryStrs[7][0]  = "-------------------------------5------------------";
#declare AryStrs[8][0]  = "------------------------------6-------------------";
#declare AryStrs[9][0]  = "-----------------------------5--------------------";
#declare AryStrs[10][0] = "----------------------------6---------------------";
#declare AryStrs[11][0] = "----------------------------6---------------------";
#declare AryStrs[12][0] = "----------------------------6---------------------";
#declare AryStrs[13][0] = "----------------------------6---------------------";
#declare AryStrs[14][0] = "---------------------------7----------------------";
#declare AryStrs[15][0] = "--------------------------7-----------------------";
#declare AryStrs[16][0] = "-------------------------7------------------------";
#declare AryStrs[17][0] = "------------------------7-------------------------";
#declare AryStrs[18][0] = "-----------------------7--------------------------";
#declare AryStrs[19][0] = "-------------------6666---------------------------";
#declare AryStrs[20][0] = "------------------7-------------------------------";
#declare AryStrs[21][0] = "-----------------7--------------------------------";
#declare AryStrs[22][0] = "----------------7---------------------------------";
#declare AryStrs[23][0] = "---------------7----------------------------------";
#declare AryStrs[24][0] = "666666666666666-----------------------------------";
//
//                         <---------------------- 50 ---------------------->

ConvertArrayOfStringsToDF3(AryStrs,"StringsToDF3.df3",8,5,1)

// #error "Stop before render"

#declare Color_2 = srgbft <0.65,0.65,0.65,0,0>;
#declare Color_3 = srgbft <0.8,0.8,0.8,0,0>;
#declare ColorMap_CloudyGraySky2 = color_map {
    [ 0 Color_2 ]
    [ 1 Color_3 ]
}
#declare Pigment_CloudyGraySky2 = pigment {
    bozo sine_wave frequency 3.33 turbulence 1.0
    color_map { ColorMap_CloudyGraySky2 }
}
#declare Sky_Sphere00 = sky_sphere {
    pigment { Pigment_CloudyGraySky2 }
    emission rgb <1,1,1>
}
#declare Camera00 = camera {
    perspective
    location <2.7,2.7,-2.701>
    sky <0,1,0>
    angle 35
    right x*(image_width/image_height)
    look_at <0,0,0>
}
#declare White = srgbft <1,1,1,0,0>;
#declare Light00 = light_source {
    <50,150,-250>, White
}
#declare Fnct00 = function {
    pattern { density_file df3 "StringsToDF3.df3" interpolate 5
     // warp { turbulence 0.02 octaves 6 omega 0.23 lambda 6 }
        translate -0.5
    }
}
#declare Fnct02a = function (x,y,z) {
    0.025-Fnct00(x,y,z)
}
#declare Fnct02b = function (x,y,z) {
    0.025-Fnct00(sqrt((x*x)+(z*z)),y,z/5)
}
#declare BrownOchre = srgb <0.7216,0.3059,0.1569>;
#declare Iso00 = isosurface {
    function { Fnct02a(x,y,z) }
    contained_by { box { -0.5,0.5 } }
    threshold 0
    accuracy 0.0005
    max_gradient 6
    all_intersections
    pigment { color BrownOchre }
    finish { phong 0.9 }
}
#declare Object00 = object {
    Iso00
    scale <3.3,0.7,3.3>
}

//---
sky_sphere { Sky_Sphere00 }
camera { Camera00 }
object { Object00 }
light_source { Light00 }