POV-Ray : Newsgroups : povray.binaries.images : uv_mapping for cylinder, disc, cone & lemon Server Time
25 Apr 2024 08:46:51 EDT (-0400)
  uv_mapping for cylinder, disc, cone & lemon (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 15:36:04
Message: <5b903024$1@news.povray.org>
Am 05.09.2018 um 08:22 schrieb Le Forgeron:

> If it can match an existing keyword and its concept, it make:
> 1. less concept to explain
> 2. less work to code
> 3. less keyword to remember
> 4. less confusion in the end

On the other hand, it needs to be noted that if the name or concept is
somewhat off, it may ADD confusion.


Post a reply to this message

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 15:38:53
Message: <5b9030cd$1@news.povray.org>
Am 05.09.2018 um 07:27 schrieb Mike Horvath:
> On 9/5/2018 12:23 AM, clipka wrote:
>> 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?
> 
> You're the one who's supposed to know!

Not invented here, so why should I have any idea how it works? ;)


Post a reply to this message

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 15:42:53
Message: <5b9031bd@news.povray.org>
Am 05.09.2018 um 09:03 schrieb Le Forgeron:

>> If "orientation" in warps does exactly(!) the same, that would be the
>> parameter name to use.
>>
>> Otherwise, there are probably better names to pick. "uv_orientation",
>> maybe?
>>
> 
> it would rather be u_orientation, or u_something, as v is already set by
> the shape and its symetry. u_zero ?

"UV" in the sense of "UV mapping" as the whole concept.

> "second_base_vector_of_half_plane_with_symetry_axis_where_u_is_zero" is
> far too long.

A tad, yes ;)


Post a reply to this message

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
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

From: Le Forgeron
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 8 Sep 2018 13:18:27
Message: <5b940463@news.povray.org>
uv_reference is the winner, works for cylinder, disc, cone, lemon and
sphere_sweep in hgpovray38

cone { -y * 0.5, 0.5, 0.5 * y, 0.25  uv_reference x texture { Verso }

cylinder { -y * 0.5, 0.5 * y, 0.5 uv_reference x  texture { Verso }

lemon {-0.5 * y, .5, 0.5 * y, .25, 1.5 uv_reference x texture { Verso }

ovus { 0.5, 0.25 distance 1 radius 2.5 texture { Verso }

disc { 0, -y, 1, 0.125 uv_reference x texture { Verso }

//
sphere { 0, 0.5 texture { Verso }

torus { 0.65, 0.25 texture { Verso }

box{ -0.5, 0.5  texture { Verso }

sphere_sweep{ cubic_spline 5 ,
  0, .5,
  1*y,0.35
  2*y,0.5
  3*y,0.35
  4*y,0.5
  uv_reference x texture { Verso }


Post a reply to this message


Attachments:
Download 'refimguvmapping.png' (290 KB)

Preview of image 'refimguvmapping.png'
refimguvmapping.png


 

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 9 Sep 2018 10:50:00
Message: <5b953318$1@news.povray.org>
Am 08.09.2018 um 19:18 schrieb Le_Forgeron:
> uv_reference is the winner, works for cylinder, disc, cone, lemon and
> sphere_sweep in hgpovray38

Sounds reasonable enough.

For some nitpicking though, your examples do have a lot of missing
closing braces, and some lack the uv_reference modifier ;)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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