POV-Ray : Newsgroups : povray.binaries.images : How does cylindrical warp work? Server Time
18 Apr 2024 10:20:45 EDT (-0400)
  How does cylindrical warp work? (Message 1 to 3 of 3)  
From: Cousin Ricky
Subject: How does cylindrical warp work?
Date: 4 May 2019 00:49:30
Message: <5ccd19da$1@news.povray.org>
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'
test_cylindrical_warp1.jpg

Preview of image 'test_cylindrical_warp2.jpg'
test_cylindrical_warp2.jpg

Preview of image 'test_cylindrical_warp3.jpg'
test_cylindrical_warp3.jpg

Preview of image 'test_cylindrical_warp4.jpg'
test_cylindrical_warp4.jpg


 

From: Bald Eagle
Subject: Re: How does cylindrical warp work?
Date: 4 May 2019 08:50:00
Message: <web.5ccd898157a169b04eec112d0@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> OK, so it turns out I don't understand cylindrical warp after all.

Heh, I went through this no so long ago.

http://news.povray.org/povray.bugreports/thread/%3Cweb.5c01b8a81374e197765e06870%40news.povray.org%3E/

I can't imagine having to conceive of the warp, code it, and make it work with
all of the rest of what's going on in POV-Ray without breaking.   :O

Maybe the discussion and my code at the end of the thread will help you puzzle a
bit more of this out.  :)


Post a reply to this message

From: Cousin Ricky
Subject: Re: How does cylindrical warp work?
Date: 4 May 2019 14:33:36
Message: <5ccddb00@news.povray.org>
On 2019-05-04 12:49 AM (-4), Cousin Ricky wrote:
> OK, so it turns out I don't understand cylindrical warp after all.
> 
> [snip]
> 
> 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.

I rendered some permutations of the example in the reference manual, and 
two things are clear.  Most obviously, I should leave dist_exp alone. 
The other is that all orientations work with a vertical cylinder. 
Extrapolating, it looks to me that the cylindrical warp always assumes a 
vertical structure, and that I should start with that assumption in 
defining the texture, then reorient it to match the object.


Post a reply to this message


Attachments:
Download 'cylindrical_warp_ref.jpg' (478 KB)

Preview of image 'cylindrical_warp_ref.jpg'
cylindrical_warp_ref.jpg


 

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