Hi Marcus,
On Tue, 2005-09-06 at 13:53 +0200, Marcus Lindblom wrote:
> Hi all,
>
> The volume story continues. :)
it's one of those neverending ones, I can promise you that. ;)
> The current cyl<->cyl test is quite naive and does not handle the common
> case with cylinders of non-infinite length.
>
> I've picked up some code from the net which fixes this, and this time it
> is useful in OpenSG. However, it uses capsules (cyls with hemispheres at
> the ends) instead of cylinders, so it is not entirely accurate either,
> although much better than the existing test.
OK, I added it.
> Capsules are faster and
> easier to handle than flat-capped cylinders, so a replacement might be
> an idea for 2.0?
Hm, maybe. Not a bad idea. Building them tightly is harder than
cylinder, but the operations actually might be easier.
> See attached file for source code on the test (it's an extract from my
> sources, thus lacking of includes and such stuff). I hope it'll be useful.
I've replaced our current intersect with, so I'd say that counts as a
yes. ;) I've also added your transform code. The build from dir and
points looked a little incomplete and didn't fit into our current API,
so I've left that our for now. Thanks for the fixes.
> P.S. W.r.t. some comments in osg::Line on handling of
> infinite/semi-infinite/non-infinite lines, I think it should be split
> into separate classes for Line, Ray and Segment, respectively. Makes it
> easier to understand and reason about geometric code. Naturally, they
> could all use a common parent class if deemed useful. (Updating CylVol
> to use an Segment would then be a nice touch. :)
Do you really think you need separate classes for that? It might make
sense in the spirit of Pnt vs. Vec, I'm just a little weary about
implementation overhead and duplicated functionality. In theory most of
the internal stuff could use the infinite line, but then we need to
return two intersections and restrict ourselves to convex volumes.
That's probably not a big deal (I can't see many people wanting toroidal
bounding volumes ;), but something that needs thinking about.
Thanks
Dirk
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users