|
|
Here is a thumbnail, along with code, of a Superpatch realization of
the three parametric surfaces you wrote about in general. As always,
watch for run-on comments in the code. This picture is tiny and not
antialiased because I couldn't afford the hours to do a better quality
rendering. Don't let that scare you: the computer I use was obsoleted
by the discovery of counting on fingers. I did a bit of scaling and
rotating to show the shapes off to somewhat good advantage, and they
look ok to me.
// Begin POV code
// Kensurf.pov - Parametric surfaces for ken
#version 3.1;
global_settings { assumed_gamma 1.0 ambient_light <.846, 1.041, 1.041>
}
camera { up <0, 1, 0> right <4 / 3, 0, 0>
location <0, 0, -20> look_at <0, 0, 0> }
light_source { <20, 50, -100> color rgb <1.103, .993, .772> }
light_source { <-20, 50, -100> color rgb <1.103, .993, .772> }
#include "colors.inc"
sky_sphere { pigment { color rgb <.5, .33, 1> } }
#declare P23 = 2 * pi / 3;
parametric // triaxial torus
{
// The following line contains the parametric equations for x, y
and z
function sin(u) * (1 + cos(v)), sin(u + P23) * (1 + cos(v + P23)),
sin(u + (2 * P23)) * (1 + cos(v + (2 * P23)))
// The following line contains the minima and maxima for <u, v>
<-pi, -pi>, <pi, pi>
// the following line is the xyz bounding box I want
<-2, -2, -2>, <2, 2, 2>
accuracy .001 // the smaller the more accurate
precompute 15, [x, y, z] // speeds it up, but eats memory
texture
{
pigment { color Red }
normal { dents 1 turbulence 2.3 scale .1 }
finish { specular 1 roughness .001 }
}
scale 2
rotate <-90, 30, -45>
translate -7 * x
}
#declare A = 10;
#declare B = 3;
#declare C = 2;
parametric // cycloid
{
// The following line contains the parametric equations for x, y
and z
function cos(u / C) * cos(u / B) * (A + cos(v)) + sin(u / B) *
sin(v) * cos(v),
sin(u / C) * cos(u / B) * (A + cos(v)) + sin(u / B) *
sin(v) * cos(v),
-sin(u / B) * (A + cos(v)) + cos(u / B) * sin(v) * cos(v)
// The following line contains the minima and maxima for <u, v>
<0, 0>, <2 * B * C * pi, 4 * pi>
// the following line is the xyz bounding box I want
<-10, -10, -10>, <10, 10, 10>
accuracy .001 // the smaller the more accurate
precompute 15, [x, y, z] // speeds it up, but eats memory
texture
{
pigment { color Yellow }
normal { bumps 1 turbulence 2.3 scale .1 }
finish { specular 1 roughness .001 }
}
scale .25
}
parametric // teardrop
{
// The following line contains the parametric equations for x, y
and z
function .5 * (1 - cos(u)) * sin(u) * cos(v), .5 * (1 - cos(u)) *
sin(u) *
sin(v), cos(u)
// The following line contains the minima and maxima for <u, v>
<0, 0>, <pi, 2 * pi>
// the following line is the xyz bounding box I want
<-2, -2, -2>, <2, 2, 2>
accuracy .001 // the smaller the more accurate
precompute 15, [x, y, z] // speeds it up, but eats memory
texture
{
pigment { color Magenta }
normal { ripples 1 turbulence 2.3 scale .1 }
finish { specular 1 roughness .001 }
}
scale 4
rotate -90 * x
translate 7 * x
}
// End POV code
Jerry Anning
clem "at" dhol "dot" com
Post a reply to this message
Attachments:
Download 'kensurf.jpg' (6 KB)
Preview of image 'kensurf.jpg'
|
|