|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> #macro LetterSign (_Letter, _Color)
blah blah blah...
I was sifting through all the code in my head, and wanted to do some marking of
the surface of my newly made prism thing.
Indenting the surface with a difference had its merits, but I wanted good
visibility without changing the geometry.
So I thought that using the objects in an object pattern would be cool - but
make it so that they went all the way through from one side to the other.
Based upon my past lessons and experiments with functions, and the excellent
advice of Mr. Pokorny, I figured I could plug the object pattern into a
function, and use that as a pigment - but scale it infinitely along one axis.
A further experiment - just jotting this down here for the future - would be to
do an intersection of 3 such orthogonal patterns, probably via an isosurface, to
get an "object" like you might cut out of a block of wood marked on 3 faces -
for further processing. Perhaps add in some of that smoothing that I worked
on...
Anyway, here's a scene showing the infinitely scaled object pattern, to produce
a silhouette.
The view is from the top, of horizontal slices, and then the sides are 2 boxes
sliced through x-y and rotated to face up, showing the effect.
#version 3.8;
global_settings {
assumed_gamma 1.0
}
#include "colors.inc"
#declare Aspect = image_width/image_height;
camera {
location <0.9, 15, -0.1>
right x*Aspect
look_at <0.9, 0, 0>
}
light_source {<40, 10, -5> color White}
plane {y, -3 pigment {White}}
#declare Object =
pigment {
object {
sphere { <0,0,0>, 0.5 }
color rgb <1, 0, 0>,
color rgb <0, 1, 0>
}
}
// Make a 2-unit box patterned with the
#declare Box = box {-1, 1 }
#declare S = 0.1;
#declare Slice = box {<-1, 0, -1> <1, -S, 1>}
#for (M, -0.3, 0.3, S)
intersection {
object {Slice translate y*4*M}
object {Box}
texture {
pigment {Object}
normal {agate 0.1 scale 0.0001}
finish {specular 0.1}
}
translate z*3
translate x*M*21
no_shadow
}
#end
difference {
object {Box pigment {Object}}
box {<-3, -3, -3>, <3, 3, 0>}
cutaway_textures
rotate x*90
translate <-8, 0, 3>
no_shadow
}
#declare F_Object = function {pigment {Object}}
#for (M, -0.3, 0.3, S)
intersection {
object {Slice translate y*4*M}
object {Box}
texture {
// give function pigment an infinite y scaling
pigment {function {F_Object (x, 0, z).red}
color_map {
[0.0 rgb <1, 0, 0>]
[1.0 rgb <0, 1, 0>]
}
}
normal {agate 0.1 scale 0.0001}
finish {specular 0.1}
}
translate -z*1
translate x*M*21
no_shadow
}
#end
difference {
box {<-1, -5, -1>, <1, 5, 1>
pigment {function {F_Object (x, 0, z).red}
color_map {
[0.0 rgb <1, 0, 0>]
[1.0 rgb <0, 1, 0>]
}
}
}
box {<-3, -6, -3>, <3, 6, 0>}
cutaway_textures
rotate x*90
translate <8, 0, 0>
no_shadow
}
Post a reply to this message
Attachments:
Download 'objectsilhouette.png' (200 KB)
Preview of image 'objectsilhouette.png'
|
|