senoutouya / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

Fully axis aligned triangles fail to rasterize #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an axis aligned triangle on the x/z plane.
2. Rasterize the triangle
3. No voxel spans appear

What is the expected output? What do you see instead?
I expect the triangle to be rendered into the voxel spans.
I don't see the triangle rendered into the voxel spans.

What version of the product are you using? On what operating system?
Not relevant. Windows 7 on 64 bit.

Please provide any additional information below.
Looking at clipPoly I changed this:

   for (int i = 0; i < n; ++i)
      d[i] = pnx*in[i*3+0] + pnz*in[i*3+2] + pd;

to
   for (int i = 0; i < n; ++i)
   {
      d[i] = pnx*in[i*3+0] + pnz*in[i*3+2] + pd;
      if (rcAbs(d[i]) < 0.000005f)
         d[i] = 0;
   }

What ended up happening was that pd was something like -6 (float 
representation!) and in[i*3+0] was +6 (float representation). The sum ended up 
being -6e-7 (in that order).

Original issue reported on code.google.com by rob...@guerrilla-games.com on 22 Feb 2012 at 10:58

GoogleCodeExporter commented 9 years ago
Hi,
Sorry for slow reaction to this. I tested the rasterizer with axis aligned 
triangles but I was not able to repro your situation. Do you happen to have the 
exact coordinates of the triangle that caused problems (and the creation 
params, including bmin). I understand what might cause the problem, but I'm 
reluctant to add a fix until I understand what's going on in there.

--mikko  

Original comment by memono...@gmail.com on 10 Mar 2012 at 8:43

GoogleCodeExporter commented 9 years ago
Hi,
Sorry for slow reaction to this. I tested the rasterizer with axis aligned 
triangles but I was not able to repro your situation. Do you happen to have the 
exact coordinates of the triangle that caused problems (and the creation 
params, including bmin). I understand what might cause the problem, but I'm 
reluctant to add a fix until I understand what's going on in there.

--mikko  

Original comment by memono...@gmail.com on 10 Mar 2012 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by memono...@gmail.com on 16 Sep 2013 at 7:02