POV-Ray : Newsgroups : povray.text.scene-files : Toroidal height field source (possible 3.5 demo scene :) Server Time
28 Jul 2024 14:28:57 EDT (-0400)
  Toroidal height field source (possible 3.5 demo scene :) (Message 1 to 2 of 2)  
From: TonyB
Subject: Toroidal height field source (possible 3.5 demo scene :)
Date: 10 Feb 2000 18:19:44
Message: <38a34790@news.povray.org>
// Persistence Of Vision raytracer version 3.5 sample file.
// Example of how to make a toroidal heightfield, using
// a pigment to displacement-map an isosurface.
// File by Anthony Bennett. 10/02/2000 (D/M/Y)
// ben### [at] panamac-comnet | ure### [at] hotmailcom
// Demonstrates isosurface, pigment function, torus function,
// and toroidal warp.
// MegaPOV 0.4 Time: about 6 minutes @640x480+A0.3 on PII400

//#version unofficial MegaPOV 0.4;

#include "colors.inc"

// Major radius.
#declare R0 = 0.7;
// Minor radius.
#declare R1 = 0.3;
// Efficient bounding box for torus.
#declare BOXL = < -(R0+R1), -R1, -(R0+R1)>;
#declare BOXH = <(R0+R1), R1, (R0+R1)>;
// Displacement ammount.
#declare H = 0.05;
// Pigment for coloring the torus.
#declare C =
pigment {
 hexagon
 scale 0.08
 warp {
  toroidal
  orientation y
  dist_exp 0.0
  major_radius R0
 }
}
// Torus function.
#declare T = function { "torus", <R0,R1> }
// "Displacement-map" pigment function.
#declare D =
function {
 pigment {
  // If you using image_map make sure to interpolate!
  // This speeds up rendering. Don't use any map_type.
  hexagon
  color White,
  color Gray50,
  color Black
  scale 0.08
  warp {
   toroidal
   orientation y
   dist_exp 0.0
   major_radius R0
  }
 }
}

// Light!
light_source { <1,1,-1>*R0*4 1 }
// Camera!
camera { location -z*R0*4 look_at 0 }
// Action!
isosurface
{
 function { T(x,y,z) + H - D(x,y,z)*H }
 contained_by { box { BOXL,BOXH } }
 eval
 pigment { C }
 rotate x*90
}

// Note: The important thing to remember is to always use
// *tilable* pigments or image_maps, otherwise, you will
// see where it wraps... unless you want that. :)


Post a reply to this message

From: TonyB
Subject: Re: Toroidal height field source (possible 3.5 demo scene :)
Date: 11 Feb 2000 09:19:37
Message: <38a41a79@news.povray.org>
I'm very sorry. I forgot to add a couple important comments to this. Please
update your files to this new/reconfigured/expanded version:


// Persistence Of Vision raytracer version 3.5 sample file.
// Example of how to make a toroidal heightfield, using
// a pigment to displacement-map an isosurface.
// File by Anthony Bennett. 10/02/2000 (D/M/Y)
// ben### [at] panamac-comnet | ure### [at] hotmailcom
// Demonstrates isosurface, pigment function, torus function,
// and toroidal warp.
// MegaPOV 0.4 Time: about 6 minutes @640x480+A0.3 on PII400

//#version unofficial MegaPOV 0.4;

#include "colors.inc"

// Major radius.
#declare R0 = 0.7;
// Minor radius.
#declare R1 = 0.3;
// Efficient bounding box for torus.
#declare BOXL = < -(R0+R1), -R1, -(R0+R1)>;
#declare BOXH = <(R0+R1), R1, (R0+R1)>;
// Displacement ammount.
#declare H = 0.05;
// Pigment for coloring the torus.
#declare C =
pigment {
hexagon
scale 0.08
scale .5
warp {
  toroidal
  orientation y
  dist_exp 0.0
  major_radius R0
}
}
// Torus function.
#declare T = function { "torus", <R0,R1> }
// "Displacement-map" pigment function.
// If you use image_map:
//  * Make sure to interpolate! (Faster rendering.)
//  * Don't use any map_type.
//  * Change the orientation from y to z.
//  * Change the scale to 1 for the
//    map to wrap without repeating.
// Note: The important thing to remember is to always use
// *tilable* pigments or image_maps, otherwise, you will
// see where it wraps... unless you want that. :)
#declare D =
function {
pigment {
  hexagon
  color White,
  color Gray50,
  color Black
  scale 0.08
  warp {
   toroidal
   orientation y
   dist_exp 0.0
   major_radius R0
  }
}
}

// Lights!
light_source { <1,1,-1>*R0*4 1 }
// Camera!
camera { location -z*R0*4 look_at 0 }
// Action!
isosurface
{
function { T(x,y,z) + H - D(x,y,z)*H }
contained_by { box { BOXL,BOXH } }
eval
pigment { C }
rotate x*90
}


Post a reply to this message

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