Greetings.

I think I've hit a bug related to the following, in OpenSG 1.8.  I'm wondering
whether there has been a patch for this in 1.8 or in 2.0.  Any news?

I found this in the archive:

On Fri, 05 Oct 2007 10:16:51 -0700
Carsten Neumann wrote:

> Re: [Opensg-users] osgSceneViewer

> Rene Weller wrote:
>> Hello,
>> 
>>> Could you please give a bit more details on what results you get and how 
>>> you obtain your triangle count?
>> 
>> your code works fine and reports the correct number of 7962 triangles. But 
>> the stats-Function in the osgSceneViewer reports 7990 triangles for the same 
>> object.
>
> ok, thanks, now I can reproduce it. The difference in numbers comes from 
> the triangle striper that seems to introduce degenerate triangles 
> (although the stitch parameter is false). The Triangle iterator skips 
> these degenerate triangles, but since calcPrimitiveCount (which is used 
> by the statistics code) only examines the length and type geo properties 
> it counts them.
> Actually both numbers are correct in a sense, because calcPrimitiveCount 
> gives you the number of triangles that are sent to the graphics card 
> while the TriangleIterator only gives you "real" triangles.
>
> @Johannes: Can you comment on this behavior of the striper, please? Is 
> it expected to generate additional triangles even when stitch is false?


In my case, I'm not using the SceneViewer stats but looking directly at
geo_ptr->getTypes() and geo_ptr->getLengths().

The number of /non-degenerate/ triangles is correct, but the geo lengths look
suspicious -- note how they increase by 4 from one primitive to the next:

   #   type   length   indices
   -   ----   ------   -------
   0     5      33     71, 0,   80, 0,   70, 0,   80, 0,   79, 0,   ...
   1     5      37
   2     5      41
   3     5      45
   4     5      49
   5     5      53
   6     5      57
   7     5      61

Using those lengths for triangle strips (type 5), the number of triangles
should be 31+35+39+43+47+51+55+59 = 360, but the first triangle strip has
a degenerate triangle:

   71, 80, 70
   70, 80, 80   <<<

and others do as well.

(The index mapping has 2 elements -- the 0's are a normal index.)

The TriangleIterator reports 352 triangles (not 360), which is correct.

The original geometry is imported from VRML as an IndexedFaceSet with 352
triangular faces (cut from an 8*22 array of quads).

Have been any new developments regarding the degenerate triangles?  Has this
been patched in 1.8 or in 2.0?

Thanks for your attention.

-- 

Ted

------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to