POV-Ray : Newsgroups : povray.general : Is it possible to warp the UV coordinates of a 2D texture map? : Re: Is it possible to warp the UV coordinates of a 2D texture map? Server Time
20 Apr 2024 07:17:29 EDT (-0400)
  Re: Is it possible to warp the UV coordinates of a 2D texture map?  
From: Kenneth
Date: 17 Jan 2022 19:00:00
Message: <web.61e6015138c4a65d4cef624e6e066e29@news.povray.org>
"tutki" <nomail@nomail> wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:

> >
> > As per the sphere object itself, the UV mapping are hard-coded (not even
> > in memory, just computed when needed)
> > But I wonder if there is something that would stop you from applying
> > warp to the texture.
>
> Warping the texture would also be an option... is there a way to specify an
> arbitrary mapping function to remap texture values?  What I have in mind is to
> use maybe a standard texture pattern as the basis, but have some kind of
> function on top of it to distort it in specific ways.
>
> Is this possible?

I'm no expert at using functions, but from simple syntax tests, it looks like a
'bare' function cannot be used to distort a pigment pattern. I.e., this
simplistic example does not work, fatal error:

#declare FUNC =
function(x){6*sin(2*pi*x)}; // *this* works OK

object{...
pigment{
    cells
    FUNC(.7).x // this fails; other syntax variations that I tried also fail
....

But it can successfully be used *in* a scale, or a turbulence, or etc:
 scale <1, FUNC(.7).x,1>

Again, these are just syntax tests; the actual results of my examples might
be... questionable, ha.

From your description of what you are trying to accomplish, maybe a 'black hole'
warp would work (with its 'inverse' keyword)?


Post a reply to this message

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