Search Unity

How to cover an area under a group of objects using LineRenderer?

Discussion in 'Scripting' started by cem_unity626, Aug 31, 2022.

  1. cem_unity626

    cem_unity626

    Joined:
    Feb 15, 2021
    Posts:
    1
    Hey there! How can I get the bounding points around a group of objects with padding/offset (expand) for my line renderer to draw an area around them? I'm trying to achieve something like the image below (it shows cubes, but it can be another shape also like spheres or smth.)

    Any help appreciated! thank you!

    The orange line represents the line renderer.

     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Google up for "enclosing hull" and I think there's various simplifications you can do in 2D, stuff like this:

    https://www.habrador.com/tutorials/math/8-convex-hull/

    There's tons of writings about how to get this information.

    Then to visualize it, some kind of procedural geometry. Plenty of examples of that online, and you can also check out my MakeGeo package for more random procgen in Unity.

    MakeGeo is presently hosted at these locations:

    https://bitbucket.org/kurtdekker/makegeo

    https://github.com/kurtdekker/makegeo

    https://gitlab.com/kurtdekker/makegeo

    https://sourceforge.net/p/makegeo