[comp.graphics] Rendering

hongde@ms.uky.edu (Hongde Luo) (11/03/90)

  I need rendering routine which can do the following:

       Given a triangle represented by three vertices: M1(x1,y1,z1),
       M2(x2,y2,z2) and M3(x3,y3,z3); the "density" at these three
       vertices are d1, d2 and d3, respectively. I also have another
       point M(x,y,z) inside the triangle. I want to find the "rendered
       density" at point M.

  I was going to do it my self but it seems more complicated than I thought,
I appreciate any pointer to a reference or a code. Thanks in advance.

                   Hongde

-- 
************************>>>> hongde@ms.uky.edu <<<<************************
*  Hongde Luo    Center for Computational Science      Univ. of Kentucky  *
************************>>>>  (606)-257-8741   <<<<************************

joerg@cat.de (Markus Schichtel) (11/08/90)

Hongde Luo (hongde@ms.uky.edu) schrieb am  3.11.:
>
>   I need rendering routine which can do the following:
>
>        Given a triangle represented by three vertices: M1(x1,y1,z1),
>        M2(x2,y2,z2) and M3(x3,y3,z3); the "density" at these three
>        vertices are d1, d2 and d3, respectively. I also have another
>        point M(x,y,z) inside the triangle. I want to find the "rendered
>        density" at point M.
>
>   I was going to do it my self but it seems more complicated than I thought,
> I appreciate any pointer to a reference or a code. Thanks in advance.
>
>                    Hongde
>
> --
> ************************>>>> hongde@ms.uky.edu <<<<************************
> *  Hongde Luo    Center for Computational Science      Univ. of Kentucky  *
> ************************>>>>  (606)-257-8741   <<<<************************

Try out barycentric coordinates.It's appropriate since your point M is inside
the triangle.Barycentric  coordinates of M are (u,v,w) where u+v+w = 1.
Then weigh the density of M1 M2 M3 by u,v,w respectively.
Note that M1 has coordinates(1,0,0) M2 (0,1,0) M3 (0,0,1) in barycentric
coordinates.If you don't know how to handle those coordinates feel free to
contact me again.

---
  Markus Schichtel (joerg@cat.de)                     
  C.A.T. Kommunikations-System, Frankfurt