Page 1 of 1

can convex hull have sink in point

Posted: Wed Feb 19, 2020 11:46 am
by parapoohda
If I want to make convex hull with there points

Code: Select all

            points[i++] = new Vector3(0, 0, 0);
            points[i++] = new Vector3(0, 0, 1);
            points[i++] = new Vector3(0, 1, 0);
            points[i++] = new Vector3(1, 0, 0);
            points[i++] = new Vector3(1, 1, 0);
            points[i++] = new Vector3(1, 0, 1);
            points[i++] = new Vector3(0, 1, 1);
            points[i++] = new Vector3(1, 1, 1);
Which is given box 1,1,1 in length wide and height.
But if I add

Code: Select all

            points[i++] = new Vector3(0, 0.5, 0);
           
into an array, it seems a new point not working.
Is convex hull can only make the smallest polygon that covers points.
Or I have done something wrong.

Re: can convex hull have sink in point

Posted: Wed Feb 19, 2020 9:42 pm
by Norbo
Is convex hull can only make the smallest polygon that covers points.
Yes, convex hulls are convex: https://en.wikipedia.org/wiki/Convex_polytope

Any points not contributing to the outer surface are removed.

If you want concave shapes, you'll need to create it out of multiple convex shapes in a Compound (or BigCompound, for shapes with a lot of children). There is also the Mesh, but that's best used for environments and statics, not individual dynamic objects.

Re: can convex hull have sink in point

Posted: Mon Feb 24, 2020 2:35 am
by parapoohda
Thank you. :):)