     POV-Ray : Newsgroups : povray.binaries.programming : texture interpolation for polygon Server Time 6 Jul 2022 02:56:48 EDT (-0400) texture interpolation for polygon (Message 1 to 1 of 1)         From: Le Forgeron Subject: texture interpolation for polygon Date: 9 Oct 2007 17:15:25 Message: <470bef6d@news.povray.org>    ```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#470bef6d%40news.povray.org",
"dateCreated": "2007-10-09T21:15:25+00:00",
"datePublished": "2007-10-09T21:15:25+00:00",
"author": {
"@type": "Person",
"name": "Le Forgeron"
}
}
Hello,

I was wondering about the texture interpolation for triangles (in
mesh), and if it would be possible to have the same kind of
interpolation on a polygon (let's assume a simple without hole
polygon for the time being, thanks).
At first, I blocked on the zero division when evaluating at a vertex
of the polygon, but then I found the following idea (see picture).
Let's a,b,c,... be the euclidean distance (or its square, after all,
do we really need a slow square root ?) from the evaluated point F
to each vertex.
It must be the euclidean distance (or based on it), because of the
needed isotropy for the interpolation.
(rotations of small angles should not change the result)

The absolute weight of the texture at point A would be the product
of all the distance but the distance from A.
The relative weight (used to weight the real texture list) is of
course divided by the sum of all absolute weights.

On Vertex A, all weights are null but for A, which give r(A)=1, just
fine.
W(x) is always positive or null.
T is always positive (assuming a polygon of more than 2 points,
without duplicated vertex).
So the division is fine.

The only sad point (but is it really sad ?) is that on the middle of
A-B, the influence of others points is not null (that's also why I
might prefer the square of the distance: less influence for more
distant points).

Does anybody sees a flaw in this idea ?

--
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius
```

Attachments:        