Hi Simon,
Simon Haegler wrote:
> osgHello
>
> i have a (small) set of normals and corresponding distances/vertices.
> my goal is to create a geometry object from them (convex polyhedron).
> what is the osg way to go?
>
> currently, i'm thinking about something like: normals/distances ->
> osg::Plane -> pairwise intersection -> osg::Line -> pairwise
> intersection -> vertices -> create faces etc
>
> or should i make a large box geometry and use Plane::clip with every face?
1) seems cleaner to me. 2) will get you into issues with n-sided polygons and
general clipping, which can get tricky.
I think it's a little more complicated than your description, though, as you
need to exclude points that are outside the object. And putting together the
faces from those vertices might not be trivial, either. You could use aconvex
hull lib for that.
Alternatively you can probably generate this using a Computational Geometry lib
like CGAL. ;)
Dirk
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users