Coefficients from paper M. Nießner Effective Back-Patch Culling for Hardware Tessellation

59 Views Asked by At

http://research.microsoft.com/en-us/um/people/cloop/vmvbpc.pdf In this paper authors show new method for backface culling bezier patches in clip space. In section 5 using symbolic algebra software for expand equation they found that all coefficient of matrix T(u,v) is the wigth sum of cross4. They generated the table:

int idx[4][] = {{i1, j1, k1, l1},
...
{im, jm, km, lm}};
float wgt[] = {w1, ..., wm};

So I am trying to make the same thing, but I never used symbolic algebra software. All that I made after 4 hours was this (Wolfram Mathematica):

B[u_, v_] := Transpose[({
     {BernsteinBasis[3, 0, u]},
     {BernsteinBasis[3, 1, u]},
     {BernsteinBasis[3, 2, u]},
     {BernsteinBasis[3, 3, u]}
    })].({
    {b0, b1, b2, b3},
    {b4, b5, b6, b7},
    {b8, b9, b10, b11},
    {b12, b13, b14, b15}
   }).({
    {BernsteinBasis[3, 0, v]},
    {BernsteinBasis[3, 1, v]},
    {BernsteinBasis[3, 2, v]},
    {BernsteinBasis[3, 3, v]}
   })

fx[a_, b_, c_] := Det[({
    {a.y, b.y, c.y},
    {a.z, b.z, c.z},
    {a.w, b.w, c.w}
   })]

fy[a_, b_, c_] := -Det[({
     {a.x, b.x, c.x},
     {a.z, b.z, c.z},
     {a.w, b.w, c.w}
    })]


fz[a_, b_, c_] := Det[({
    {a.x, b.x, c.x},
    {a.y, b.y, c.y},
    {a.w, b.w, c.w}
   })]

fw[a_, b_, c_] := -Det[({
     {a.x, b.x, c.x},
     {a.y, b.y, c.y},
     {a.x, b.z, c.z}
    })]


cross4[a_, b_, c_] := Transpose[({
    {fx[a, b, c], fy[a, b, c], fz[a, b, c], fw[a, b, c]}
   })]

T[a_, b_] := 
 cross4[B[a, b], D[B[u, v], u] /. u -> a /. v -> b, 
  D[B[u, v], v] /. u -> a /. v -> b]

Can someone, who good with symbolic algebra, help me to generate this table?

0

There are 0 best solutions below