Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!