File:Fractal trees on isosurface 1 r 1.png
Original file (1,600 × 1,200 pixels, file size: 2.34 MB, MIME type: image/png)
Captions
Summary
[edit]DescriptionFractal trees on isosurface 1 r 1.png |
English: Fractal trees on isosurface. Created with POV-Ray. |
Date | |
Source | Own work |
Author | Merikanto |
POV-Ray 3.7 source code
//
// fractal tree example
// ground isosurface, offset of trees with functrion that match simple multiple sin() based isosurface
// POV-Ray 3.7 source code
//
// 20.7.2023 0000.0000
//
- include "colors.inc"
- include "textures.inc"
- include "stones.inc"
- include "woods.inc"
- include "rand.inc"
- include "functions.inc"
- include "transforms.inc"
camera {
// location <0, 20, -10>/3
// location <0, 10, -10>/3
location <7, 1, -10> *1/10
// location <0, 10, 0> /2
look_at <0,0,0>
// look_at <0, 1, -1>
// angle 27
angle 45
}
sky_sphere {
pigment {
gradient y
color_map { [0.0 color rgb <1,1,1.2>*0.8] [1.0 color rgb <0,0,1>] }
}
}
light_source { <-30, 30, -30>*1000*1000*1000 White }
//light_source { <-20, 50, -40> White }
- declare groundtex2=texture {
// agate
wrinkles
scale 3
texture_map {
[0 pigment { granite scale 0.1 } normal {agate scale 0.1} ]
[1 pigment { granite scale 0.1 color_map { [0 color Green/2][0.3 color (Green+Yellow)/2] [0.6 color (Green+Tan)/2] [0.6 color Tan/2] } } normal {granite scale 0.1} ]
}
}
- declare groundtex1= texture {
// pigment {checker color Green color <0,.6,0> scale 0.15}
pigment {
// color rgbt <124, 252, 0>/255
// color rgbt <138/255, 154/255, 91/255,0>/3
//wrinkles scale 0.1
// crackle turbulence 0.6
granite
// turbulence 0.1
//color_map {
//[0 color rgbt <138/255, 154/255, 91/255,0>/3]
// [1 color rgbt <.5,.5,.5,0>/4 ]
//}
color_map {
[0 color rgbt <138/255, 154/255, 91/255,0>/3]
[1 color rgbt <124, 252, 0>/255 ]
}
}
normal {
//crackle turbulence 1 scale 0.01
//granite scale 0.03
spotted scale 0.003 bump_size 30
// agate
// wrinkles scale 0.1
bump_size 10
}
finish {specular 0.6}
}
- declare planeground1=plane {
y, -2
pigment {color Green}
// texture {groundtex2}
}
- declare watertex1= texture
{
pigment { color rgb < 0.3, 0.3, 0.7 > }
normal { bumps 0.2 scale < .5, 0.25, 0.15 > }
finish { phong 1 reflection 1.0 ambient 0.2 diffuse 0.2 specular 1.0 }
}
- declare water1=plane
{
y, 0
texture
{
watertex1
}
translate < 0, .20 , 0 >
}
//object {planeground1}
- declare obj1= object {
//sphere {0,1}
cone {0,0.75,<0,2,0>,0.003}
translate y*0
// Reorient_Trans(-y,-y)
}
//object { obj1 translate inter1 }
/*
object {
sphere { 0,1 }
scale y/10
scale 10
pigment {color Red}
}
- /
#macro tree1(level, levels1)
// seed(1239)
- if((level)>levels1)
// sphere {0,0.2 pigment {color Green}}
cone { <0,0,0>, 0.15, <0,1,0>, 0.005 pigment {color rgb <10,72,30>/255 } scale 1}
- else
cone {
<0, 0, 0>,.05, <0, 1, 0>, .04
scale 1
pigment {color <130,112,100>/255}
normal {granite}
}
//#declare level=level+1;
// sphere {0,0.2 pigment {color Red}}
union{
union { tree1(level+1, levels1)
rotate z*-60 *rand(1)
}
union { tree1(level+1, levels1)
rotate z*60 *rand(1)
}
union { tree1(level+1, levels1)
rotate x*-60 *rand(1)
}
union { tree1(level+1, levels1)
rotate x*60 *rand(1)
}
translate y*1
#declare sk2=max(rand(1),1)*0.2+0.8;
scale sk2*0.7
}
- end
- end
#declare ypos1 = 0;
- macro yyyy(x1,z1)
//#declare ypos1=0-sin(sqrt ( x1*x1+z1*z1 ))
- declare ypos1=0-sin(sqrt ( (x1*x1+z1*z1)*10))/2-sin(x1*10)/2-sin(z1*10)/2 ;
//+sin(x1-z1);
- declare ypos1=ypos1/20;
- end
- declare field1=union {
- for (zz,-5,5)
- for (xx,-5,5)
- declare skal1=.1;
- declare x1=xx*skal1;
- declare z1=zz*skal1;
- declare x2=x1+skal1;
- declare z2=z1+0;
- declare x3=x1+skal1;
- declare z3=z1+skal1;
- declare x4=x1+0;
- declare z4=z1+skal1;
yyyy(x1,z1);
- declare y1=ypos1;
yyyy(x2,z2);
- declare y2=ypos1;
yyyy(x3,z3);
- declare y3=ypos1;
yyyy(x4,z4);
- declare y4=ypos1;
- declare p1= <x1,y1,z1>;
- declare p2= <x2,y2,z2>;
#declare p3= <x3,y3,z3>;
#declare p4= <x4,y4,z4>;
- declare po1 = polygon { 3, p1,p4,p2 };
#declare po2 = polygon { 3, p4,p2,p3 };
// #declare po3 = polygon { 5,p4,p3,p2,p1,p4 };
//object {po1 }
//object {po2 }
// object {po3 texture { pigment {color Red}}}
//object {sphere {0,0.1} texture { pigment {color Red}} translate <x1,y1,z1>}
//object {sphere {0,0.03} texture { pigment {color Red}} translate <x1,y1,z1>}
// object { obj1 scale 0.03 texture {pigment{ color Green } } translate <x1,y1,z1> }
object { union {tree1(0,3) scale 0.03 } translate <x1,y1,z1> }
- end
- end
}
- declare iso1= object {
isosurface {
function { y-0+sin(sqrt ( (x*x+z*z)*10))/2+sin(x*10)/2+sin(z*10)/2 }
accuracy 0.01
max_gradient 45
contained_by {sphere {0,5}}
}
}
- macro randomlocs_in_surf(nunna)
#for (nn,0,nunna)
- declare x1= rand(1)*2-1;
- declare z1= rand(1)*2-1;
yyyy(x1,z1);
- declare y1=ypos1;
- if(y1>0.0)
object {
sphere {0,1}
// cone {<0,0,0>,1,<0,1,0>,0.01 }
//scale 0.003
//object { union {tree1(0,2) } translate z*-0}
texture {pigment { color rgb <0,1,0>/6} }
translate <x1,y1,z1>
translate z*0
}
- end // end if
- end // loop
- end // macro
object {planeground1 texture {groundtex1} translate y*1.95}
object {
disc { 0,<0,1,0>,0.8 }
texture {watertex1 scale 0.02}
translate y*-0.049
}
//object {water1 scale 0.1 translate y*-2/5}
object {field1}
object {iso1 scale y/20 translate z*-0
//texture {pigment {color Green/5}
texture {groundtex2 scale 0.05}
//normal {granite }
// translate y*5
// rotate x*90
}
//randomlocs_in_surf(100)
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 13:16, 20 July 2023 | 1,600 × 1,200 (2.34 MB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
PNG file comment |
|
---|---|
File change date and time | 13:12, 20 July 2023 |
Software used |