POV-Ray : Newsgroups : povray.text.scene-files : Source code for "Inside the Crackle pattern" Server Time
1 Nov 2024 07:24:46 EDT (-0400)
  Source code for "Inside the Crackle pattern" (Message 1 to 2 of 2)  
From: Tor Olav Kristensen
Subject: Source code for "Inside the Crackle pattern"
Date: 18 Oct 2000 11:10:48
Message: <39EDBC5D.65D00C77@hotmail.com>
Below is the source code for an image I posted 18. Oct. to the
povray.binaries.images news group; "Inside the Crackle pattern"

news://news.povray.org/39ED7446.9FDB0DAA%40hotmail.com

Note that MegaPOV is needed for rendering of this iso-surface.


Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
// Copyright 2000 by Tor Olav Kristensen
// mailto:tor### [at] hotmailcom
// http://www.crosswinds.net/~tok/tokrays.html
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version unofficial MegaPov 0.6;

#include "colors.inc"

global_settings { ambient_light color White }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare CrackleFunction =
function {
  pigment {
    crackle
    color_map {
      [ 0 rgb 0 ]
      [ 1 rgb 1 ]
    }
    scale 10
    translate 130*x
  }
}

#declare MidOfCrackleSquare =
function {
  CrackleFunction(
    floor(x) + 0.5,
    floor(y) + 0.5,
    floor(z) + 0.5
  )
}

#declare SphereFunction =
function {
  "sphere" <0.2>
}

#declare ManySpheres =
function {
  SphereFunction(
    x - floor(x) - 0.5,
    y - floor(y) - 0.5,
    z - floor(z) - 0.5
  )
}

#declare Threshold = 1 - 0.6;

#declare CrackleSpheres =
isosurface {
  function {
    if(
      MidOfCrackleSquare(x, y, z) - Threshold,
      ManySpheres(x, y, z),
      1
    )
  }
  threshold 0.2
  contained_by { sphere { <0, 0, 0>, 2000 } }
  method 2
}

object {
  CrackleSpheres
  pigment { color White + Blue }
/*
  pigment {
    bozo
    turbulence 0.7
    color_map {
      [ 0.0 color Blue ]
      [ 1.0 color White ]
    }
    scale 4
  }
*/
  no_shadow
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

light_source {
  5*<10, 0, -1>
//  4*<-5, 0, 2>
  color White
  fade_distance 70
  fade_power 3
}

camera {
  location <23, 8, -49>/2
  look_at <0, 1, 0>
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Source code for "Inside the Crackle pattern" -> v3.5
Date: 22 May 2002 20:18:18
Message: <3CEC347B.D0EEA7C2@hotmail.com>
Tor Olav Kristensen wrote:
> 
> Below is the source code for an image I posted 18. Oct. to the
> povray.binaries.images news group; "Inside the Crackle pattern"
> 
> news://news.povray.org/39ED7446.9FDB0DAA%40hotmail.com
> 
> Note that MegaPOV is needed for rendering of this iso-surface.


And here is a rewritten version for POV-Ray v3.5


Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
// Copyright 2002 by Tor Olav Kristensen
// Email: t o r _ o l a v _ k [ a t ] h o t m a i l . c o m
// http://hjem.sol.no/t-o-k/povray
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.5;

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

global_settings { ambient_light color White }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

light_source {
  <10, 0, -1>*5
  color White*3
  fade_distance 70
  fade_power 3
  shadowless
}

camera {
  location <23, 8, -49>/2
  look_at <0, 1, 0>
//  angle 90
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Fn = function(a) { floor(a) + 0.5 }

#declare CrackleFn =
  function {
    pattern {
      crackle
      scale 10
      translate 130*x
    }
  }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare SphereThreshold = 0.4; // Use values between 0 and 1

#declare SpheresRadius = 0.4; // Use values between 0 and 1

isosurface {
  function {
    select(
      CrackleFn(Fn(x), Fn(y), Fn(z)) - SphereThreshold,
      1,
      f_sphere(x - Fn(x), y - Fn(y), z - Fn(z), SpheresRadius)
    )
  }
  max_gradient 6
  contained_by { sphere { <0, 0, 0>, 2000 } }
  pigment { color (White + Blue)/3 }
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

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