OK, so it turns out I don't understand cylindrical warp after all.
A few years ago, I introduced cylindrical textures to CoffeeMug in the
object collection. Looking back to see how I could adapt the code to
work with cylinders or cones oriented in different directions, I
realized that I had never specified any orientation for the coffee mug!
I went back to RTFM to see how it would be done.
The orientation keyword would seem to do the trick, but the doc says
that the default is <0, 0, 1>. My coffee mug is vertically oriented,
and my code works without changing the default.
I whipped up a test scene to investigate the orientation keyword. I
used Parse_String() to make sure that the SDL for each test case exactly
matched the annotation text. In these scenes, p_Test is defined as
pigment { square scale 1/8 }.
True to the docs, orientation z matches the default, not orientation y.
And somehow, orientation z corresponds to a cylinder with axis y. I do
not understand why this is; and more importantly, I have no clue how to
get a cylindrical warp to match a cylinder of arbitrary orientation.
How does it work?
Also, I am bemused by the cylinder illustration, which somehow works
with a vertical cylinder and orientation y, and I am befuddled the
spiral at the top; but since the example uses a non-default dist_exp
(whose explanation soars way above my head), I don't know if it's relevant.
Post a reply to this message
Attachments:
Download 'test_cylindrical_warp1.jpg' (37 KB)
Download 'test_cylindrical_warp2.jpg' (46 KB)
Download 'test_cylindrical_warp3.jpg' (39 KB)
Download 'test_cylindrical_warp4.jpg' (48 KB)
Preview of image 'test_cylindrical_warp1.jpg'
Preview of image 'test_cylindrical_warp2.jpg'
Preview of image 'test_cylindrical_warp3.jpg'
Preview of image 'test_cylindrical_warp4.jpg'
|