POV-Ray : Newsgroups : povray.text.scene-files : Source code for "Spherical Splash" Server Time
1 Nov 2024 05:21:45 EDT (-0400)
  Source code for "Spherical Splash" (Message 1 to 3 of 3)  
From: Tor Olav Kristensen
Subject: Source code for "Spherical Splash"
Date: 9 Mar 2001 21:24:59
Message: <3AA98FA4.1388F2F5@hotmail.com>
This is the source code for the "Spherical Splash" image that 
I posted 6. March to the povray.binaries.images news group:

news://news.povray.org/3AA41C10.55F23524%40hotmail.com

MegaPOV is needed for this.

Have fun !


Tor Olav

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

#version unofficial MegaPov 0.6;

#include "colors.inc"

// I "borrowed" radiosity settings, colors and texture from Gilles Tran 
// and then I modified them a bit.

global_settings {
  ini_option "+QR"
  radiosity {
    recursion_limit 4
    brightness 1.4
    normal on
    error_bound 0.2
    pretrace_start 0.08
    pretrace_end 0.002
  }
}

$ Blaa = color <0.22, 0.41, 0.79>;
$ Gul = color <0.95, 0.78, 0.42>;

$ OtherTexture =
texture {
  pigment {
    bozo
    color_map {
      [ 0 color White*0.7 ]
      [ 1 color White*1.3 ]
    }
  }
  normal {
    agate 0.8
    scale 3
  }
  finish { 
    ambient -0.3
    diffuse 0.8
    specular 0.1
    roughness 0.1
    metallic
    brilliance 1
  }
  scale 0.5
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =
// My iso functions

$ A = 4.0;   // Frequency of noise
$ B = 0.5;   // Amount of noise
$ C = 2.0;   // Frequency of rotation
$ D = pi/12; // Amount of rotation
$ R = 2.1;   // Sphere "radius"

$ Noise = function { 1 - 2*noise3d(x, y, z) }

$ Sphere = function { sqrt(x^2 + y^2 + z^2) }

$ NoisySphere = function { Sphere(x, y, z) - B*Noise(A*x, A*y, A*z) }

$ XAngle = function { D*Noise(C*(x + 50), C*y, C*z) }
$ YAngle = function { D*Noise(C*x, C*(y + 50), C*z) }
$ ZAngle = function { D*Noise(C*x, C*y, C*(z + 50)) }

$ RotSphere =
function {
  NoisySphere(
    ( x*cos(YAngle) + ( y*sin(XAngle) + z*cos(XAngle))*sin(YAngle))*
        cos(ZAngle) - ( y*cos(XAngle) - z*sin(XAngle))*sin(ZAngle),

    ( x*cos(YAngle) + ( y*sin(XAngle) + z*cos(XAngle))*sin(YAngle))*
        sin(ZAngle) + ( y*cos(XAngle) - z*sin(XAngle))*cos(ZAngle),

    (-x*sin(YAngle) + ( y*sin(XAngle) + z*cos(XAngle))*cos(YAngle))
  )
}

$ IsoBall =
isosurface {
  function { RotSphere(x, y, z) - R }
  max_gradient 10
  method 2
  contained_by { sphere { <0, 0, 0>, R + B } }
}

object {
  IsoBall
  texture { OtherTexture }
  rotate 20*y
  no_shadow
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 =
// And then the environment

sky_sphere {
  pigment {
    gradient y
    color_map {
      [ 0 color White ]
      [ 1 color Blaa ]
    }
  }
}

light_source {
  1220*vnormalize(< -1, 6, 1>), color Gul
  area_light 100*x, 100*z, 5, 5 jitter orient
}

camera {
  location 10*vnormalize(< 1, 0.63, -1>)
  look_at <0, 0, 0>
  angle 45
}

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


Post a reply to this message

From: Nekar Xenos
Subject: Re: Source code for "Spherical Splash"
Date: 10 Mar 2001 04:55:29
Message: <3aa9fa11@news.povray.org>
Thanks.

Nekar


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Source code for "Spherical Splash"
Date: 10 Mar 2001 05:41:01
Message: <3AAA03E6.6ECB760B@hotmail.com>
Tor Olav Kristensen wrote:
> 
> This is the source code for the "Spherical Splash" image that
> I posted 6. March to the povray.binaries.images news group:
>...

Ooops. There's an error in the code below.
You need to remove the no_shadow statement.

>...
> object {
>   IsoBall
>   texture { OtherTexture }
>   rotate 20*y
>   no_shadow
> }
>...

Sorry. I didn't see this until I test rendered during the night 
what I had posted.


-- 
Best regards,

Tor Olav

mailto:tor### [at] hotmailcom
http://hjem.sol.no/t-o-k/tokpicts.html
http://www.crosswinds.net/~tok


Post a reply to this message

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