POV-Ray : Newsgroups : povray.binaries.images : IsoStones : Re: IsoStones Server Time
5 Nov 2024 10:22:29 EST (-0500)
  Re: IsoStones  
From: PM 2Ring
Date: 11 Sep 2005 23:20:01
Message: <web.4324f3c08195286ad93754b0@news.povray.org>
"PM 2Ring" <nomail@nomail> wrote:
> This group of stones is a single isosurface. The wet sand is a
> normal-perturbed plane. The stone textures are the standard textures
> in stones.inc.
>
> Now I just need to figure out how to perturb the stones' positions a bit
> more...

Thanks everyone for all the nice comments. Here's the source code:

//------------------------------------------------------------

// Persistence of Vision Ray Tracer Scene Description File
// File: IsoBalls.pov
// Vers: 3.6
// Desc: Multiple distorted spheres using a single isosurface
// Date: 2005.09.03
// Auth: PM 2Ring
//
//  -D +A0.1 +AM2 +R2
//  -F +A0.6 +AM2 +R2
//

#include "colors.inc"
#include "stones.inc"
#include "functions.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 7
}

#declare W = 1/8;                  //Cell width
#declare R = W*.70;                 //Stone radius
#declare D = 0.875/R;              //Radius deformation rate
#declare H = .55;                  //Stone height

#declare StoneMax=44;

#declare T_Stones = array[StoneMax]{
  T_Stone1, T_Stone2, T_Stone3, T_Stone4, T_Stone5,
  T_Stone6, T_Stone7, T_Stone8, T_Stone9, T_Stone10,
  T_Stone11, T_Stone12, T_Stone13, T_Stone14, T_Stone15,
  T_Stone16, T_Stone17, T_Stone18, T_Stone19, T_Stone20,
  T_Stone21, T_Stone22, T_Stone23, T_Stone24, T_Stone25,
  T_Stone26, T_Stone27, T_Stone28, T_Stone29, T_Stone30,
  T_Stone31, T_Stone32, T_Stone33, T_Stone34, T_Stone35,
  T_Stone36, T_Stone37, T_Stone38, T_Stone39, T_Stone40,
  T_Stone41, T_Stone42, T_Stone43, T_Stone44,
}

#declare MultiStone = texture{
  cells translate 0.5*y+11
  texture_map{
  #declare I=0;
  #while(I<StoneMax)
    [I/StoneMax T_Stones[I]]
    [(I+1)/StoneMax T_Stones[I]]
    #declare I=I+1;
  #end
  }
}

#declare smod = function(A,B) {mod(B+mod(A,B),B)}
//#declare scmod = function(A,B) {smod(A,2*B)-B}

#declare f_cnoise = function(x,z) {(W-R)*f_snoise3d(floor(x*.5/W), 0,
floor(z*.5/W))}
#declare f_modnoise = function(x,z) {smod(x,2*W)-W+f_cnoise(x,z)}

//Stones
isosurface{
  function {f_r(f_modnoise(x,z), y/H, f_modnoise(-z,x)) - R*(1 +
..5*f_snoise3d(x*D,y*D,z*D))}

  contained_by{box{<-1,-W*H,-1>,<1,W*H,1>}}
  max_gradient 1.65//12.65 // 10 // 16
  accuracy 5e-3

  texture {MultiStone scale 2*W}

  rotate -3*y
  translate y*(0.35*R*H-1) + z*1
}

//------------------------------------------------------------

#if(1)
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.4 rgb 0.1]
      [0.9 rgb 0.8]
      [1 rgb 1]
    }
  }
}
#else
background{rgb .5}
#end

//Wet sand
#if(1)
plane {
  y, -1.0001
  pigment {rgb <1,.915,.620>}
  finish{ambient 0 diffuse 0.65 specular .25 roughness 1e-3
reflection{0,.9}}
  normal {
     ripples 0.075
     frequency 12
     turbulence .175
     scale .4
     translate -1
  }
}
#end

#declare CamPos = <0.45, 8, -8> * .2;
//#declare CamPos = 4*y;            //Overhead
camera {
  location CamPos
  direction z
  right     x*image_width/image_height up y
  look_at   y*-.175
  angle 40
}

light_source {
  <-1, 1, -1> * 30
  //rgb 1.75
  rgb 135
  spotlight point_at <-1,-1,0> falloff 2.25 radius 0.35
  area_light 9*x,9*z,7,7 jitter adaptive 1 orient circular
  fade_distance 3 fade_power 2
}

//------------------------------------------------------------


Post a reply to this message

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