Hello
I have the ollowing problem:
Given the three 3d vertices of a triangle and a point x, y, z inside the triangle: What is the fastest way to interpolate (eg edge-point intenities) for the point x,y,z?
Thanks a lot
Pipo
Hello
I have the ollowing problem:
Given the three 3d vertices of a triangle and a point x, y, z inside the triangle: What is the fastest way to interpolate (eg edge-point intenities) for the point x,y,z?
Thanks a lot
Pipo
>Given the three 3d vertices of a triangle and a point x, y, z inside the triangle: What is the >fastest way to interpolate (eg edge-point intenities) for the point x,y,z?
hmm, maybe you express more exact what you are going to do ?
styx/headcrash
http://www.head-crash.de
Dunno if it's the fastest way, but here's the standard linear algebra way that I'd do it:
If you have a triangle with vertices A, B, C and a point in the middle P and you want to find the point X on a side then you need to do this:Code :B | \ | \ | \ | \ | \ | \ | .P \ | /| \ | / | \ A---------C X
(i) Use a local coordinate system for each point e.g. set the origin at A so you have the vector C.
(ii) You also have the vector P.
(iii) Calculate the projection of P onto C using the formula X = {C'*P/(C'*C)}*C where ' is the transpose and * is vector multiplication (i.e. you can just swap the '* symbols for dot product).
(iv) The part inside the curly brackets gives you the distance along CA to X from A.
(v) Interpolate intensities.
(v) Repeat twice so you have points X, Y and Z, one for each edge of the triangle.
I'd be interested if anyone else has any faster methods.
Hope that helps.
<edit>ASCII art didn't turn out too well </edit>
<edit2>Found a better explanation than mine with diagrams and stuff at http://astronomy.swin.edu.au/pbourke...try/pointline/</edit2>
[This message has been edited by ffish (edited 06-09-2001).]
[This message has been edited by ffish (edited 06-09-2001).]