POV-Ray : Newsgroups : povray.binaries.images : uv_mapping for cylinder, disc, cone & lemon : Re: uv_mapping for cylinder, disc, cone & lemon Server Time
2 May 2024 13:03:22 EDT (-0400)
  Re: uv_mapping for cylinder, disc, cone & lemon  
From: clipka
Date: 6 Sep 2018 09:18:06
Message: <5b91290e$1@news.povray.org>
Am 05.09.2018 um 06:23 schrieb clipka:

>> And the tie is now between:
>> * **direction**, as used in camera and rainbow
>> * **orientation**, as used in warp (cylindrical, spherical, toroidal)
> 
> I'm looking at the warps' "orientation" parameter right now, and it
> gives me headaches. What is it even? A vector in pigment space to pick a
> different slice of the pigment? A vector in shape space to orient the
> torus/sphere/cylinder?

One thing I can say by now is that the `orientation` vector in e.g.
cylindrical `warp` does /not/ change the orientation in shape space;
there, the rotational axis of the pattern always extends along the Y
axis, and the seam is always in the same place as well.

So re-using the same keyword for the scene-space orientation of UV
mapping seams would be prone to adding confusion.


Instead, the `orientation` vector governs what axes correspond to
"height", "angle" and "radius", respectively.

My best bet is that the math was hand-crafted/hacked/botched to get
certain effects for the special cases `orientation x`, `orientation y`
and `orientation z` - namely giving pattern-space orientation zYX, XZy
and XYZ, respectively (`zYX` e.g. meaning that the "angle" corresponds
to negative Z, the "height" to positive Y, and the "radius" to positive
X). The design goal for chosing these specific three orientations may
have been to make the "height", "angle" and "radius" axes
"right-handed", perpendicular and normalized, let the axis aligned with
X have positive orientation, and let the "radius" axis be aligned with
the `orientation` vector.

Not much care seems to have gone into the formula otherwise; most
notably, if the `orientation` vector is not axis-alinged, the effect
does _not_ correspond to a straightforward re-orientation (i.e.
rotation) of the "height", "angle" and "radius" axes in pattern space,
but rather includes anisotropic scaling (and maybe also shearing; I
didn't examine that), even if the `orientation` vector is normalized.


Fun fact: The optional VECTOR parameter of the `planar` warp applies
exactly the same kind of transformangling, although it doesn't use the
keyword.


Post a reply to this message

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