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

Question Method for doubling triangles in a mesh

Discussion in 'Scripting' started by CptHavvock, Aug 14, 2022.

  1. CptHavvock

    CptHavvock

    Joined:
    Dec 30, 2021
    Posts:
    12
    I was looking into increasing the number of triangles in a mesh(doubling them while keeping the same mesh form) and then I realized that some vertices are used by multiple triangles.

    I opened paint to try and find the ratio between the doubling of the triangles and the number of vertices (image below), but I couldn't find any kind of relation.

    Is there a way to find how many vertices will be needed in relation to how many triangles are made? Or at least, can what I'm trying to do be done with another procedure?

    PS: In the image, triangles are actually the T value divided by 3.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    You don't really need to care about the number... use a collection such as List<T> that can accommodate any number of new verts.

    Do the subdivision of a given triangle (by whatever subdivision strategy you prefer) and produce the new geometry.

    Make sure you wind your triangles properly. :)
     
    CptHavvock likes this.
  3. CptHavvock

    CptHavvock

    Joined:
    Dec 30, 2021
    Posts:
    12
    Thank you, once I understood that what i'm looking for is mesh subdivision, I was able to find web articles talking about what I want to do exactly to my mesh. Apparently I just needed to know the correct terminology for what I was doing.
     
    Kurt-Dekker likes this.