Hi Teodor,

Am 29.02.2012 15:56, schrieb Teodor Hanchevici:
> Hi,
> 
> I have trouble getting all the points that are contained in a polytope. I 
> have 5 points and their coordinates are:
>
>  [...]
> 
> A couple of questions:
> 1. When constructing a polytope from a list of planes, do I have to take care 
> of the normal of the plane? The documentation says "When adding planes, their 
> normals should point inwards (into the volume)", does this apply to void 
> osg::Polytope::add(const osg::Plane & pl) method only?

The normal direction is very important.
In fact, you get a different polytope when one normal direction is flipped:
Think of a cube and add another plane which intersects
all 6 planes. Obviously the cube is split into 2 polytopes
and only the normal direction determines which
one you want.

I have not checked your example but you can easily find
out which plane is wrongly oriented by calling Plane::distance
on your points and checking if the values of that function-call
are positive or negative.


> 2. Is there a better method of achieving this?

No, you have to get your normals right.

> Thank you!
> 
> Cheers,
> Teodor

Cheers,

Peter
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Michael Heinrichs, 
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to