Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
Filling the area between points with a material in Unity at runtime

I am creating a random shape that is formed from placing points (3 or more points) on a plane (most of the time the plane is horizontal). After connecting these points, a closed shape is created (Polygon from points and lines).

I want to fill the inside area with a texture or a material.

I know I can create a mesh and a mesh renderer to show the material, but I am not sure how to create the mesh from vertices only. I have no idea how to make triangles of the mesh.

Edit 1: I found good answers from this question: Given an irregular polygon's vertex list, how to create internal triangles to build a flat 3D mesh efficiently? .

I am facing many problems with the solutions. Some methods work with convex and others with concave polygons.

Also, some solutions convert concave polygons to convex before getting triangles (it uses the convex-hull method to get boundaries).

Also when adding the material to the created mesh, it looks different than the original material. The small mesh at the middle of this image is the created mesh at runtime with the same material as the plane mesh on the background (plane mesh is created from the editor before running the application).

Material issue

Is there a library or a plugin that handles the creation of the mesh by just passing to it an ordered list of vertices and a material?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda