Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Creating triangles from coordinates

Discussion in 'Scripting' started by XukeLho, Mar 24, 2015.

  1. XukeLho

    XukeLho

    Joined:
    Dec 30, 2014
    Posts:
    199
    Hi, im trying to give a face to an object by creating triangles stores in a vec3 array.
    Image A shows a visual representation of what i have.
    Image B shows an aproximate version of what i want to have. Except i dont want lines but a 3d shape. And for that i need to dynamicaly create some triangles (i assume).
    This is not the only shape i have, thats why i cant create a single script for every shape. Extruding it on max (or any other 3d modeling software) is out of the question too. I really must read the coordinates and create some triangles.


    PS.: Ignore the green line on image B. its a bug that i am working on to correct.
     

    Attached Files:

  2. Brominion

    Brominion

    Joined:
    Sep 30, 2012
    Posts:
    48
    in the documentation you will find what you are looking for as far building the mesh.
    http://docs.unity3d.com/ScriptReference/Mesh.html
    also googling "how to generate procedural mesh in unity" or similar will probably generate some good info.
    I am not sure there the old example projects are hiding these days, but there used to be one.
     
  3. XukeLho

    XukeLho

    Joined:
    Dec 30, 2014
    Posts:
    199
    That isnt enough. i need something more complex than that. Polygon triangulation or something along those lines.
     
  4. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    XukeLho and Brominion like this.
  5. XukeLho

    XukeLho

    Joined:
    Dec 30, 2014
    Posts:
    199