POV-Ray : Newsgroups : povray.binaries.images : Bezier-patch torus : Re: Bezier-patch torus Server Time
21 May 2024 18:31:53 EDT (-0400)
  Re: Bezier-patch torus  
From: Bald Eagle
Date: 5 Sep 2018 12:15:01
Message: <web.5b900079dc5d6572c437ac910@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> >>> * bicubic_patch
> >
> > UV coordinates are based on the patch's parametric coordinates. They stretch
> > with the control points. The default range is (0..1) and can be changed.
> >
> > Well THERE's a teaser for you.  That should really be "...and can be changed by
> > ....."  or followed by a link, or "see section ...."
>
> Or "see below", because there it is: `uv_vectors`.
>
> Granted, the addition of the "Additional UV Exmaples" picture has
> increased the distance between that statement and the `uv_vectors`
> explanation.


I do believe that I sometimes ask one question, and you answer another.
(And I've just noticed on an old thread that sometimes I can read the same
question in one of two ways, and the ambiguity of the meaning even makes ME
interpret it differently the second time I read it and respond to a reply.)


For bicubic patches the UV coordinates can be specified for each of the four
corners of the patch. This goes right before the control points.
The syntax is:

  uv_vectors <corner1>,<corner2>,<corner3>, <corner4>
with default
  uv_vectors <0,0>,<1,0>,<1,1>,<0,1>

"The default range is (0..1) and can be changed...."

There is no "explanation" that you refer to.
For me, an explanation would be along the lines of changing those uv vectors and
showing the effect it has on how a unit-square texture gets mapped on it.
Then you add "scale" into the mix, and it can be pretty unclear - unless you
ALREADY know what's going on and you're reading the documentation
"retroactively", in hindsight, which I think is what often happens when some of
the docs get written or referred to.

"Look, newbie - the docs say exactly that, and we're all telling you that the
text isn't inconsistent with what happens..."
Very technically correct in highly qualified courtroom attorney-shyster
legalese, but of no use to the first-time, or even sometimes the tenth-time or
hundredth-time reader.

The documentation wasn't written by you (AFAIK), but your reply was -
unenlightening.  As a [semi]alert reader, I can see where you're going with it,
having played with the uv mapping of bicubic patches before, but I think my
original point still stands - the statement that "The default range is (0..1)
and can be changed...." just sort of HANGS there.....

 uv_vectors <corner1>,<corner2>,<corner3>, <corner4>
with default
  uv_vectors <0,0>,<1,0>,<1,1>,<0,1>

Simply exemplifies the default, but doesn't do anything to explain the latter
part about how changes are made, what their effect is, or even hint at why you'd
want to change them.




> A parametric is /defined/ by the inverse process of UV mapping: Instead
> of computing UV coordinates from given 3D coordinates of a point on the
> surface, you start with a 1x1 square in UV space and transform it into
> 3D space via a function f(u,v)->(x,y,z). (In practice, POV-Ray uses a
> set of three functions, f1(u,v)->x, f2(u,v)->y, f3(u,v)->z.)
>
> So finding the ray-surface intersection points of a parametric boils
> down to finding (u,v) pairs such that f(u,v)=(x,y,z), and thus the UV
> coordinates are a trivial side product of that process.

I had a go at this last night, and still need to fix/add back part of the code
that might make my understanding of this work.  I got it "right", then I redid
it a different way, then realized I needed BOTH...

Let me offer my insight into this, both as an alternative explanation to
interested readers, and as an example of what might be a more illuminating way
of explaining the same situation.


Instead of U and V - the parametric is often defined via functions of Theta and
Phi.  There's nothing special about either of these sets of variables

Theta and Phi are just (assuming a non-zero span) ranges of values.

If those values are normalized, we can see how if we arrange them orthogonally,
we can lay them out as "axes" of a unit square.
Then when we "plot" (calculate) the x,y,z values of the parametric, we use those
axes as the number lines that Theta and Phi travel along.  U and V of the
unit-square UV texture are the normalized, planar surface defined by those two
vectors.

So yes, when I follow that line of thought, when we raster-scan through the
whole range of V's over all of the U's, then each UV "pixel" of the texture will
be mapped 1:1 with each point of the parametric, and one can "translate" that
little bit of color over to the <x,y,z> point in space where the parametric
equations evaluate to.

"> ... and thus the UV
> coordinates are a trivial side product of that process."

Right-o.  And so it is.


Post a reply to this message

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