POV-Ray : Newsgroups : povray.binaries.programming : texture interpolation for polygon Server Time: 17 Dec 2018 01:01:47 GMT
  texture interpolation for polygon (Message 1 to 1 of 1)  
From: Le Forgeron
Subject: texture interpolation for polygon
Date: 9 Oct 2007 21:15:25
Message: <470bef6d@news.povray.org>
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


Post a reply to this message


Attachments:
Download 'expl.png' (24 KB)

Preview of image 'expl.png'
expl.png


 

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