POV-Ray : Newsgroups : povray.binaries.scene-files : Isofunctions.inc - isofunctions.inc (1/1) Server Time
2 Sep 2024 18:17:47 EDT (-0400)
  Isofunctions.inc - isofunctions.inc (1/1) (Message 1 to 1 of 1)  
From: Chris Huff
Subject: Isofunctions.inc - isofunctions.inc (1/1)
Date: 24 Mar 2000 18:24:47
Message: <chrishuff_99-EABC44.18265524032000@news.povray.org>
Here is the first version of Isofunctions.inc, a collection of 
isosurface/function pattern functions I have created. This includes 
functions for most of the official version's patterns.

-- 
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Web page: http://chrishuff.dhs.org/
//	Persistence of Vision Ray Tracer Scene Description File
//	File: isofunctions.inc
//	Date: 2000.3.24
//	Author: Chris J. Huff
//	Desc: A group of (hopefully) useful functions for use in
//		isosurfaces and function patterns.
//		Be warned: not all of them have been tested fully.

#declare oldVers = version;
#version unofficial MegaPov 0.4;



// Isosurface pattern functions
// Most of these use the pigment function feature, a few
// use the actual functions for speed.
// I will change more of them to use functions instead of pigments
// in later versions of the include file.
// Some of these are not implemented because they require special
// parameters that must be specified in the definition. For the same
// reason, you probably would want to define your own versions of
// some of these functions.
#declare FuncColMap =
color_map {[0 color rgb 0][1 color rgb 1]}

#declare AgateFn = function {pigment {agate color_map {FuncColMap}}}
// average not implemented
#declare BoxedFn = function {1-min(1, max(abs(x), max(abs(y), abs(z))))}
#declare BozoFn = function {noise3d(x,y,z)}
#declare BrickFn = function {pigment {brick color rgb 0, color rgb 1}}
#declare BumpsFn = function {noise3d(x,y,z)}
#declare CheckerFn = function {pigment {checker color rgb 0, color rgb 1}}
#declare CrackleFn = function {pigment {crackle color_map {FuncColMap}}}
#declare CylindericalFn = function {1-min(1, sqrt(sqr(x) + sqr(z)))}
// density_file not implemented
#declare DentsFn = function {noise3d(x,y,z)^3}
#declare GradientYFn = function {pigment {gradient y color_map {FuncColMap}}}
#declare GraniteFn = function {pigment {granite color_map {FuncColMap}}}
#declare HexagonFn = function {pigment {hexagon color rgb 0, color rgb 0.5, color rgb
1}}
#declare LeopardFn = function {pigment {leopard color_map {FuncColMap}}}
#declare MandelFn = function {pigment {mandel 25 color_map {FuncColMap}}}
#declare MarbleFn = function {pigment {marble color_map {FuncColMap}}}
#declare OnionFn = function {pigment {onion color_map {FuncColMap}}}
#declare PlanarFn = function {pigment {planar color_map {FuncColMap}}}
// quilted not implemented
#declare RadialFn = function {pigment {radial color_map {FuncColMap}}}
#declare RipplesFn = function {pigment {ripples color_map {FuncColMap}}}
#declare SphericalFn = function {pigment {spherical color_map {FuncColMap}}}
#declare Spiral1Fn = function {pigment {spiral1 2 color_map {FuncColMap}}}
#declare Spiral2Fn = function {pigment {spiral2 2 color_map {FuncColMap}}}
#declare SpottedFn = function {noise3d(x,y,z)}
#declare WavesFn = function {pigment {waves color_map {FuncColMap}}}
#declare WoodFn = function {pigment {wood color_map {FuncColMap}}}
#declare WrinklesFn = function {pigment {wrinkles color_map {FuncColMap}}}


// Noise functions
#declare Noise1 = function {noise3d(x,y,z)}
#declare Noise2 = function {abs(noise3d(x,y,z)-0.5)*2}
#declare Noise3 = function {noise3d(x,y,z)-0.5}


// Waveform functions
#declare SineWave = function {sin(x*z*pi)*y}
	// SineWave(val, amplitude, frequency)
#declare ScallopWave = function {abs(sin(x*z*pi)*y)}
	// ScallopWave(val, amplitude, frequency)


// Miscellaneous functions
#declare Clamp = function {min(y, max(x, z))}
#declare Average = function {(x+y+z)/3}
#declare Min3 = function {min(x, min(y, z))}
#declare Max3 = function {max(x, max(y, z))}

// These may not be right, I was just guessing at them.
#declare Theta = function {atan2(x,z)/(2*pi)}
#declare Phi = function {(atan2(y,sqrt(sqr(x)+sqr(z)))-pi)/(2*pi)}


#version oldVers;


Post a reply to this message

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