POV-Ray : Newsgroups : povray.binaries.images : uv_mapping for cylinder, disc, cone & lemon Server Time
6 Nov 2024 16:30:33 EST (-0500)
  uv_mapping for cylinder, disc, cone & lemon (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Le Forgeron
Subject: uv_mapping for cylinder, disc, cone & lemon
Date: 3 Sep 2018 15:12:27
Message: <5b8d879b@news.povray.org>
user control is achieved by adding "uv_mapping direction" in cylinder,
disc, cone and lemon

code available at
https://github.com/LeForgeron/povray/commit/83a269c227ab08e6e426670f30ed18a524360b17

> https://github.com/LeForgeron/povray/commit/83a269c227ab08e6e426670f30ed18a524360b17

first point of cone is always uv(0,0), even if the internal code later
performs an inversion.

Disc center or inner circle is v(0), outside is v(1)



cone { -y * 0.5, 0.5, 0.5 * y, 0.25  uv_mapping x texture { Verso }
transform{ Trans }  translate VS* y + 6 * x }

cylinder { -y * 0.5, 0.5 * y, 0.5 uv_mapping x  texture { Verso }
transform { Trans } translate 6 * x }

lemon
{
  -0.5 * y, .5, 0.5 * y, .25, 1.5 uv_mapping x texture
  {
    Verso
  } transform { Trans } translate - VS* y + 6 * x
}

ovus { 0.5, 0.25 distance 1 radius 2.5 texture { Verso }
transform { Trans } translate - VS * y}

disc { 0, -y, 1, 0.125 uv_mapping x texture { Verso } transform { Trans
} translate +VS*y }

sphere { 0, 0.5 texture { Verso }  transform { Trans}  translate - VS* y
- 6 * x}

torus { 0.65, 0.25 texture { Verso }  transform { Trans } translate - 6 * x}

box{ -0.5, 0.5  texture { Verso } transform { Trans }  translate VS* y -
6 * x }

box { 0, <1, 1, 0> texture { Flat }  scale 3 translate - 3/2 * x - y }


Post a reply to this message


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

Preview of image 'refimguvmapping.png'
refimguvmapping.png


 

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 3 Sep 2018 19:21:06
Message: <5b8dc1e2$1@news.povray.org>
Am 03.09.2018 um 21:12 schrieb Le_Forgeron:
> user control is achieved by adding "uv_mapping direction" in cylinder,
> disc, cone and lemon
> 
> code available at
> https://github.com/LeForgeron/povray/commit/83a269c227ab08e6e426670f30ed18a524360b17
...

> cone { -y * 0.5, 0.5, 0.5 * y, 0.25  uv_mapping x texture { Verso }
> transform{ Trans }  translate VS* y + 6 * x }

I haven't taken a closer look at it yet, but I presume the UV mapping is
oriented such that the seam lies in the half-plane defined by the axis
of rotation and the vector specified after `uv_mapping`?

That's the parameterization I would have suggested, too.

However, I'm not happy with the syntax, as `uv_mapping` without any
parameter is already a valid general object modifier, which allows to
turn on UV mapping in the object rather than in the texture.

That modifier could be hacked to allow for an optional vector parameter
when the object is a cylinder, cone or lemon, but that would indeed be
rather... hackish.


Post a reply to this message

From: Le Forgeron
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 4 Sep 2018 07:28:20
Message: <5b8e6c54$1@news.povray.org>
Le 04/09/2018 à 01:21, clipka a écrit :
> Am 03.09.2018 um 21:12 schrieb Le_Forgeron:
>> user control is achieved by adding "uv_mapping direction" in cylinder,
>> disc, cone and lemon
>>
>> code available at
>>
https://github.com/LeForgeron/povray/commit/83a269c227ab08e6e426670f30ed18a524360b17
> ...
> 
>> cone { -y * 0.5, 0.5, 0.5 * y, 0.25  uv_mapping x texture { Verso }
>> transform{ Trans }  translate VS* y + 6 * x }
> 
> I haven't taken a closer look at it yet, but I presume the UV mapping is
> oriented such that the seam lies in the half-plane defined by the axis
> of rotation and the vector specified after `uv_mapping`?

Exactly !

> 
> That's the parameterization I would have suggested, too.
> 
> However, I'm not happy with the syntax, as `uv_mapping` without any
> parameter is already a valid general object modifier, which allows to
> turn on UV mapping in the object rather than in the texture.
> 
> That modifier could be hacked to allow for an optional vector parameter
> when the object is a cylinder, cone or lemon, but that would indeed be
> rather... hackish.
> 

Oh, I didn't notice uv_mapping was an object modifier, and not a pattern 
(texture/pigment/... ) only.

Might have to introduce a new keyword then, for that purpose.

My current problem is adding such rotation of uv in sphere_sweep: it is 
far simpler for sphere_sweep to get a float between 0 and 1 for that 
purpose... unless I drop the current computation of the first mapping 
which use the plane of the first two non-colinear segment for setting 
the current origin.

So, one or two keywords to find, meaningful... and short, but not ambiguous.


Post a reply to this message

From: Le Forgeron
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 4 Sep 2018 13:16:15
Message: <5b8ebddf$1@news.povray.org>
Le 04/09/2018 à 13:28, Le Forgeron a écrit :
> 
> Oh, I didn't notice uv_mapping was an object modifier, and not a pattern
> (texture/pigment/... ) only.

> So, one or two keywords to find, meaningful... and short, but not
> ambiguous.

And the tie is now between:
* **direction**, as used in camera and rainbow
* **orientation**, as used in warp (cylindrical, spherical, toroidal)

Any preferences ?


Post a reply to this message

From: Bald Eagle
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 4 Sep 2018 16:45:01
Message: <web.5b8eee896842dff8c437ac910@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> > So, one or two keywords to find, meaningful... and short, but not
> > ambiguous.
>
> And the tie is now between:
> * **direction**, as used in camera and rainbow
> * **orientation**, as used in warp (cylindrical, spherical, toroidal)
>
> Any preferences ?

Do you want to [re]use other keywords?
What about axis, or alignment, or maybe as clipka said - half_plane ?


Post a reply to this message

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 00:23:56
Message: <5b8f5a5c$1@news.povray.org>
Am 04.09.2018 um 19:16 schrieb Le_Forgeron:
> Le 04/09/2018 à 13:28, Le Forgeron a écrit :
>>
>> Oh, I didn't notice uv_mapping was an object modifier, and not a pattern
>> (texture/pigment/... ) only.
> 
>> So, one or two keywords to find, meaningful... and short, but not
>> ambiguous.
> 
> 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?

> Any preferences ?

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?


Post a reply to this message

From: clipka
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 00:24:53
Message: <5b8f5a95$1@news.povray.org>
Am 05.09.2018 um 06:23 schrieb clipka:

> Otherwise, there are probably better names to pick. "uv_orientation", maybe?

... or "uv_seam_direction"?


Post a reply to this message

From: Mike Horvath
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 01:27:53
Message: <5b8f6959@news.povray.org>
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!

:D


Post a reply to this message

From: Le Forgeron
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 02:22:37
Message: <5b8f762d$1@news.povray.org>
Le 04/09/2018 à 22:43, Bald Eagle a écrit :
> Le_Forgeron <jgr### [at] freefr> wrote:
> 
>>> So, one or two keywords to find, meaningful... and short, but not
>>> ambiguous.
>>
>> And the tie is now between:
>> * **direction**, as used in camera and rainbow
>> * **orientation**, as used in warp (cylindrical, spherical, toroidal)
>>
>> Any preferences ?
> 
> Do you want to [re]use other keywords?
> What about axis, or alignment, or maybe as clipka said - half_plane ?
> 

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

The hell would be a SDL with every subpart having its own private set of 
keywords, because "it was not exactly the same concept, nor the same 
thing, so it has to be a dedicated keyword."

Imagine cylinder and sphere declaration using keywords:

cylinder{ disc_center_base_position <v>, disc_center_apex_position <w>, 
radius_of_cylinder r }

sphere { center_sphere_position <v>, radius_of_sphere r }

That's not user-friendly.




TBH, I did not even remembered that there was a rainbow in Pov-Ray.


Post a reply to this message

From: Le Forgeron
Subject: Re: uv_mapping for cylinder, disc, cone & lemon
Date: 5 Sep 2018 03:03:50
Message: <5b8f7fd6$1@news.povray.org>
Le 05/09/2018 à 06:23, clipka a écrit :
> Am 04.09.2018 um 19:16 schrieb Le_Forgeron:
>> Le 04/09/2018 à 13:28, Le Forgeron a écrit :
>>>
>>> Oh, I didn't notice uv_mapping was an object modifier, and not a pattern
>>> (texture/pigment/... ) only.
>>
>>> So, one or two keywords to find, meaningful... and short, but not
>>> ambiguous.
>>
>> 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?

For me it's the dist_exp which is more obscure: it's explained for 0, 
but what are other value ? (btw, a "box" (2D) <0,0> to <1,1> extended to 
infinity along orientation... isn't that a square and a normal to 
select... what ? On second reading, the box is infinite along 
orientation and a square in perpendicular directions.

And what is that "distance" in the text ?

Yet another case of: better open the source to understand.


At least, I understand "planar", but there is no picture for it !
And "cubic", nice cubic !

> 
>> Any preferences ?
> 
> 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 ?

"second_base_vector_of_half_plane_with_symetry_axis_where_u_is_zero" is 
far too long.

I would like to avoid more than one "_" if possible (so u_zero_direction 
is one word too long). Two words is nice (look_at, point_at), but three 
or more words become painful (yet, I added rational_bezier_patch 
elsewhere, so it's not so wrong, just if it could be avoided).

Oh, and for sphere_sweep, it would be the direction of u=0 for v=0, yet 
later along the sweep it would turn for continuity.

Native speakers, you're welcome !


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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