POV-Ray : Newsgroups : povray.binaries.images : cylindrical pattern : Re: cylindrical pattern Server Time
9 Aug 2024 03:22:47 EDT (-0400)
  Re: cylindrical pattern  
From: Slime
Date: 15 Mar 2005 15:04:53
Message: <42373fe5@news.povray.org>
> Yes I see that that works except the effect seems to translate by z*1
> but I've got to say, for me this is all completely counter intuitive.
> Whether I use it for a pigment or for a hf I picture the function, as
> described in the docs as a sort of column along the y axis such that any
> point on the y xis would return a value of 1, any value at x=1 and z=0
> would return 0 for all values of y, etc.  That seems to happen if I use
> the function in a pigment whether I rotate or not.

That is all correct.

The thing is, when you use the function 1000,1000 {...} syntax, it generates
a 1000x1000 image from the pattern. However, it does not know *how* this
image is going to be used! When images are loaded from files (with the
syntax    tga "myimage.tga"), they are placed vertically, covering the area
from <0,0,0> to <1,1,0> and stretching in the z direction. So it makes sense
that when the function width,height syntax is used to *generate* an image,
it samples from that area also. It doesn't know that you're going to take
that image and use it in a height field, so it doesn't know that it would be
more convenient to sample from <0,0,0> to <1,0,1>.

So, you have to prepare your function to be sampled from the region <0,0,0>
to <1,1,0>, and recognize that after that sampling is done, the data will be
used in a different orientation. Kind of like the sampled area of the
texture were rotate 90 degrees around the x-axis, and then raised along the
y-axis depending on its value at a given point.

What you want is a cross-section of the cylindrical pattern along the x-z
plane. But function width,height samples along the x-y plane, so you have to
take your pattern and rotate it around the x-axis by 90 degrees so that the
cross section you're interested in lies along the x-y plane. That's where it
is then sampled, and that data is turned into a height field.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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