POV-Ray : Newsgroups : povray.binaries.images : vororock Server Time
6 Nov 2024 12:18:41 EST (-0500)
  vororock (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: ingo
Subject: vororock
Date: 13 Feb 2019 07:43:13
Message: <XnsA9F58B9255DFEseed7@news.povray.org>
"Cipped" away about half of 9000 cells. Increasing chance on a "grain" 
along y axis, so the lower ones will be bigger.

---%<------%<------%<---
#version 3.7;
global_settings{assumed_gamma 1.0}
#default{finish{ambient 0.1 diffuse 0.9}}
#include "math.inc"
#include "transforms.inc"
#include "rand.inc" 

// run: scene
// run: voro++pov.py -c "%i %q %w %p %s %t %l" -o -v -1 40 -1 40 -1 40 
vorobox.txt
// run: scene


camera{
  perspective angle 50
  location  <0,30,-100>
  look_at   <0,-5,0>
}
light_source{< -500,300,-500> rgb <0.3,0.3,0.6>}
light_source{<1500,3000,-30> rgb 1}

#macro VoroPolygons(Normals, FaceIndex, Vertices)
  /*==
  Creates a single voronoi cell from data generated by Voro++ by 
constructing
  a polygon per face.
  
  Normals   (arr, vec) : an array of normals
  FaceIndex (arr, int) : an array with indices that points to vertices
  Vertices  (arr, vec) : an array with vertices of the cell faces
  */
  #local Length = dimension_size(FaceIndex,1);
  #local Voro = union{
    #for(Face,0,Length-1,1)
      #local VertexIndices = FaceIndex[Face];
      #local Normal = Normals[Face];
      #local Distance = vdot(Normal,Vertices[VertexIndices[0]]);
      #local Transform = transform{translate Normal*Distance};//*scale 
      #local VILength = dimension_size(VertexIndices,1);
      polygon{
        VILength+1,
        #for(VertexIndex,0,VILength-1,1)
          #local Index = VertexIndices[VertexIndex];
          #local Vertex = Vertices[Index];
          #local Vertex = VProject_Plane(Vertex, Normal);
          #local Vertex = vtransform(Vertex, Transform);
          #if (VertexIndex = 0)
            #local P0 = Vertex;
          #end 
          Vertex
        #end
        P0
      }
    #end
  }
  object{Voro}
#end

#macro Id2Coord(Id, Xn, Yn)
  #local Zi = floor(Id/(Xn*Yn));
  #local Yi = floor((Id-Zi*Xn*Yn)/Xn);
  #local Xi = Id-(Zi*Xn*Yn)-(Yi*Xn);
  (<Xi,Yi,Zi>)
#end 

#macro Coord2Id(Coord, Xn, Yn)
  (Coord.x+Xn*Coord.y+Xn*Yn*Coord.z)
#end

#declare OutFile = "vorobox.txt";
#declare IncFile = "vorobox.inc";
#declare Stream = seed(7);
#declare N = 40;
#declare N3 = pow(N,3);
#declare arrGrid = array[N3];

// first run
#if(!file_exists(OutFile))
  #fopen Voro OutFile write
  #for(I,0,N3,1) 
    #declare Coord = Id2Coord(I,N,N);
    #declare Probability = pow(10, 3*(Coord.y+1)/N)/1000;
    #if(Prob(Probability, Stream))
      #declare Point = VRand(Stream) + Coord;
      #write(Voro,I," ",Point.x," ",Point.y," ",Point.z,"\n")
    #end
  #end
#end

// second run
#if(file_exists(IncFile))
  #include IncFile
  #debug concat(IncFile,"\n")
  #declare Length = dimension_size(Labels,1);
  union{
    #for(I,0,Length-1,1)
      #declare Label = Labels[I];
      #declare Coord = Id2Coord(Label, N, N);
      #if(Coord.y<Coord.x+5)
        #declare Point = Points[I];
        #declare Normals = FaceNormal[I];
        #declare FaceIndex = FaceVerticesIndex[I];
        #declare Vertices = RelVertices[I];
        object{VoroPolygons(Normals, FaceIndex, Vertices) scale 0.9 
translate Point pigment{rgb 1}}
      #end
    #end
    translate <-N/2,-N/2,-N/2>
    rotate <0,-45,0>
  }
#end


Post a reply to this message


Attachments:
Download 'vororocks.jpg' (151 KB)

Preview of image 'vororocks.jpg'
vororocks.jpg


 

From: Bald Eagle
Subject: Re: vororock
Date: 13 Feb 2019 09:00:00
Message: <web.5c6422682b722427765e06870@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> "Cipped" away about half of 9000 cells. Increasing chance on a "grain"
> along y axis, so the lower ones will be bigger.

This is looking really impressive!  :)

This would be even better if we had a [user-controlled] internal voronoi
generator in POV-Ray.  :)


Post a reply to this message

From: ingo
Subject: Re: vororock
Date: 13 Feb 2019 09:33:28
Message: <XnsA9F59E437D7Dseed7@news.povray.org>
in news:web.5c6422682b722427765e06870@news.povray.org Bald Eagle wrote:

> This would be even better if we had a [user-controlled] internal voronoi
> generator in POV-Ray.  :)
> 

If I could, I would stick the voro++ into POV-Ray,

ingo


Post a reply to this message

From: Thomas de Groot
Subject: Re: vororock
Date: 14 Feb 2019 02:28:04
Message: <5c651884$1@news.povray.org>
On 13-2-2019 15:33, ingo wrote:
> in news:web.5c6422682b722427765e06870@news.povray.org Bald Eagle wrote:
> 
>> This would be even better if we had a [user-controlled] internal voronoi
>> generator in POV-Ray.  :)
>>
> 
> If I could, I would stick the voro++ into POV-Ray,
> 

Indeed, indeed.

Very nice karstic slope by the way.

-- 
Thomas


Post a reply to this message

From: ingo
Subject: Re: vororock
Date: 14 Feb 2019 03:00:25
Message: <XnsA9F65BA0521B2seed7@news.povray.org>
in news:5c651884$1@news.povray.org Thomas de Groot wrote:

> karstic

Had to look that up. Interesting stuff.

ingo


Post a reply to this message

From: Thomas de Groot
Subject: Re: vororock
Date: 14 Feb 2019 06:50:49
Message: <5c655619$1@news.povray.org>
On 14-2-2019 9:00, ingo wrote:
> in news:5c651884$1@news.povray.org Thomas de Groot wrote:
> 
>> karstic
> 
> Had to look that up. Interesting stuff.
> 

Well, it is not /truly/ karstic in a RL sense, but it could be used for 
one in our POV-Ray world. :-)

-- 
Thomas


Post a reply to this message

From: ingo
Subject: Re: vororock
Date: 14 Feb 2019 08:13:49
Message: <XnsA9F690C2037FFseed7@news.povray.org>
in news:5c655619$1@news.povray.org Thomas de Groot wrote:

> not /truly/ karstic

but it gave inspiration, or at least made me think back many moons when 
trying to create erosion in a df3. The animation of that is gone from the 
server sadly and I don't have it anymore.

I was thinking, let a gradient pigment with some turbulence define the 
chance of a grain placement (yes/no). This creates lager and smaler rocks 
depending on the gray value. Use a somehowe derived pigment to determine 
the hardness of the stone. Remove voronoi cells from the grid depending on 
the hardness. Can be done with some trickery in assigning the labels to 
the cells I think. May need an awfull big grid for that to get something 
coherent. Will investigate.

ingo


Post a reply to this message

From: Thomas de Groot
Subject: Re: vororock
Date: 15 Feb 2019 02:30:00
Message: <5c666a78$1@news.povray.org>
On 14-2-2019 14:13, ingo wrote:
> in news:5c655619$1@news.povray.org Thomas de Groot wrote:
> 
>> not /truly/ karstic
> 
> but it gave inspiration, or at least made me think back many moons when
> trying to create erosion in a df3. The animation of that is gone from the
> server sadly and I don't have it anymore.
> 
> I was thinking, let a gradient pigment with some turbulence define the
> chance of a grain placement (yes/no). This creates lager and smaler rocks
> depending on the gray value. Use a somehowe derived pigment to determine
> the hardness of the stone. Remove voronoi cells from the grid depending on
> the hardness. Can be done with some trickery in assigning the labels to
> the cells I think. May need an awfull big grid for that to get something
> coherent. Will investigate.
> 

Interesting. I m curious to see the results of that cogitation. 
Fascinating to see how inspiration works...

-- 
Thomas


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: vororock
Date: 15 Feb 2019 18:30:00
Message: <web.5c674aef2b722427264be49d0@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> "Cipped" away about half of 9000 cells. Increasing chance on a "grain"
> along y axis, so the lower ones will be bigger.
>...

Fascinating image. Well done !

Did you post your Python code somewhere ?

--
Tor Olav
http://subcube.com


Post a reply to this message

From: ingo
Subject: Re: vororock
Date: 16 Feb 2019 02:57:36
Message: <XnsA9F85B2532CE2seed7@news.povray.org>
in news:web.5c674aef2b722427264be49d0@news.povray.org Tor Olav Kristensen 
wrote:

> Did you post your Python code somewhere ?
> 

in binaries.utilities

<XnsA9F1C5330417Dseed7@news.povray.org>

ingo


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.