Hi Martin,

I have just had a look at your submission and back at this rather
ancient plugin and it's implementation does look rather flaky, and
it's how I'd implement this type of functionality today.  Your own
changes to get things to work with your model don't feel right to me
either, they more point that the underlying design/implementation is
wrong and needs refactoring.

One approach might be to use the TriangleIndexFunctor to hide all the
complexities of handling different types of primitives.

Robert.

On 25 March 2013 13:42, Martin Simonovsky <[email protected]> wrote:
> Hi,
> I noticed that the Normal computation plugin (in release 3.0.1) doesn't 
> consider the actual indices of vertices and normals when processing 
> PrimitiveSetLists, it just assumes that they are stored linearly with no 
> repetition. This - at least for my models - leads to crashes. I fixed this by 
> using Geometry::PrimitiveSetList::index() method calls. The fix applies to 
> all PrimitiveSetLists; however, I could only verify the fix on types 
> TRIANGLES and TRIANGLE_STRIP with BIND_PER_VERTEX. If anyone could comment on 
> how it behaves with BIND_PER_PRIMITIVE_SET, BIND_PER_PRIMITIVE, QUADS, and 
> POLYGON, it would be great.
>
> The proposed code is attached.
> Thank you!
>
> Cheers,
> Martin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=53283#53283
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/normals_148.cpp
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to