POV-Ray : Newsgroups : povray.text.scene-files : Source code for "Squirted pigments" Server Time
23 Dec 2024 02:50:14 EST (-0500)
  Source code for "Squirted pigments" (Message 1 to 1 of 1)  
From: Tor Olav Kristensen
Subject: Source code for "Squirted pigments"
Date: 27 Sep 2001 19:52:05
Message: <3BB3BBA6.388C46C3@hotmail.com>
Here's the source code for an image that i posted
27. Sept. to povray.binaries.images:

news://news.povray.org/3BB27DF4.9E762B14%40hotmail.com

Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =
// Copyright 2001 by Tor Olav Kristensen
// mailto:tor### [at] hotmailcom
// http://www.crosswinds.net/~tok
// http://hjem.sol.no/t-o-k
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =

#version 3.5;

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

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

#declare CrackleFn = function { pattern { crackle  } }

#declare ScaledCrackleFn =
function(x, y, z, S) { CrackleFn(x/S, y/S, z/S) }

#declare NoiseFn = function { 0.1 + 4*f_noise3d(x, y, z) }

#declare NoisyScaledCrackleFn =
function(x, y, z, Xo, Yo, Zo) {
  ScaledCrackleFn(x, y, z, NoiseFn(x + Xo, y + Yo, z + Zo))
}

#declare GreyFn =
function { NoisyScaledCrackleFn(x, y, z, 0.0, 0.0, 0.0)*0.25 + 0.2 }

#declare RedFn =
function { NoisyScaledCrackleFn(x, y, z, 0.1, 0.0, 0.0) }

#declare GreenFn =
function { NoisyScaledCrackleFn(x, y, z, 0.0, 0.1, 0.0) }

#declare BlueFn =
function { NoisyScaledCrackleFn(x, y, z, 0.0, 0.0, 0.1) }

#declare NormalFn =
function { NoisyScaledCrackleFn(x, y, z, 0.0, 0.0, 0.0) }

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

#declare GreyMap =
color_map {
  [ 0 color rgbt <0, 0, 0, 0/1> ]
  [ 1 color rgbt <6, 6, 6, 0/1> ]
}

#declare RedMap =
color_map {
  [ 0 color rgbt <0, 0, 0, 1/2> ]
  [ 1 color rgbt <6, 0, 0, 1/2> ]
}

#declare GreenMap =
color_map {
  [ 0 color rgbt <0, 0, 0, 2/3> ]
  [ 1 color rgbt <0, 6, 0, 2/3> ]
}

#declare BlueMap =
color_map {
  [ 0 color rgbt <0, 0, 0, 3/4> ]
  [ 1 color rgbt <0, 0, 6, 3/4> ]
}

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

#declare ColorMixTexture = 
texture {
  pigment {
    function { GreyFn(x, y, z) }
    color_map { GreyMap }
  }
  normal { function { NormalFn(x, y, z) } }
}
texture {
  pigment {
    function { RedFn(x, y, z) }
    color_map { RedMap }
  }
  normal { function { NormalFn(x, y, z) } }
}
texture {
  pigment {
    function { GreenFn(x, y, z) }
    color_map { GreenMap }
  }
  normal { function { NormalFn(x, y, z) } }
}
texture {
  pigment {
    function { BlueFn(x, y, z) }
    color_map { BlueMap }
  }
  normal { function { NormalFn(x, y, z) } }
}

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

sphere {
  <0, 0, 0>, 5
  texture { ColorMixTexture }
}

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

light_source { <-1,  2, -3>*100, color White }

background { color Blue/2 }

camera {
  location < 10, 0, -17>*0.7
  look_at <0, 0, 0>
}

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


Post a reply to this message

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