|
![](/i/fill.gif) |
Christian Froeschlin <chr### [at] chrfr de> wrote:
>
> Also, for smoothly curved objects you can highlight their
> outer contours using the aoi pattern.
That might work in theory, but in practice it usually looks terrible.
Here's something I've used that works fairly well for outlining an object:
#declare MyObj =
union{
box{-1, 1 scale <1, .2, .2>}
box{-1, 1 scale <.2, 1, .2>}
box{-1, 1 scale <.2, .2, 1>}
}
#declare NPts = 32; // number of "samples"
#declare Rad = .04; // outline thickness
// the object rendered normally
object{MyObj pigment{rgb 1}}
// the object's outline
merge{
// the Golden Spiral laid out onto a sphere
#local Inc = pi * (3 - sqrt(5));
#local Off = 2 / NPts;
#for(K, 0, NPts-1)
#local Y = K * Off - 1 + (Off / 2);
#local R = sqrt(1 - Y*Y);
#local Phi = K * Inc;
object{
MyObj
translate <cos(Phi)*R, Y, sin(Phi)*R>*Rad
}
#end
texture{pigment{rgbt 1}}
// the color of the outline
interior_texture{
pigment{rgb z/4}
finish{ambient 1 diffuse 0}
}
no_shadow
}
There will be artifacts which may or may not be eliminated by choosing points
throughout a sphere, not just on the surface of one.
Speaking of which... if one of you math geniuses out there could produce a means
for distributing points /within/ a sphere using the Golden Spiral, that would
help a lot (it would help make a great proximity pattern).
Sam
Post a reply to this message
|
![](/i/fill.gif) |