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

Generating a IcoSphere on the fly

Discussion in 'General Graphics' started by JGattes, Nov 18, 2015.

  1. JGattes

    JGattes

    Joined:
    Nov 18, 2015
    Posts:
    10
    Hi all, that's my first time playing around with mesh generation during runtime. I want to generate a IcoSphere, I have a very basic question it actually.

    I found the code to implement that here: http://wiki.unity3d.com/index.php/ProceduralPrimitives

    I understand the geometry stuff going on in the code. But I don't know how to exactly "call' the code within my game. It is, the code creates a class. Fine. But how can I use such class in my game code to generate the mesh in a way I can see it, chose its world location, etc. In other words, how can I use that code to properly have my icosphere showing on the screen?

    Many thanks!
     
  2. JGattes

    JGattes

    Joined:
    Nov 18, 2015
    Posts:
    10
    I just notice that I double-posted the question without wanting to. But the forum system does not allow me to fully delete the thread. So, for the sake of organization, don't consider this one. Consider the next with similar title.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    Just add a meshrenderer component. The mesh should be centered around the game object.