Search Unity

Wireframe for a terrain

Discussion in 'Scripting' started by ratamorph, Feb 28, 2008.

  1. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    I was wondering if someone knows if it's possible to code a script that would display the wireframe of a terrain made using the terrain editor.

    I tried to get to the renderer component of the terrain and it says that the terrain doesn't have that component so I'm pretty stuck.
     
  2. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    I wanted that too, when building terrain, but i found a workaround for that.

    I used a grid texture on the terrain... you can calculate the needed grid size by synchronizing heightmap-size with texture-size. The result is very exact. So if you dont need the mesh to be transparent, it works pretty well that way.
     
  3. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Cool, how do you apply the texture to the terrain?
     
  4. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    Just apply the grid texture as the first terrain-texture. Make your Texture just a square with a border and set its size to 1 in the terrain inspector.

    Look at the terrain docs if you dont know how to add textures to the terrain-object at all.
     
  5. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    I see, I was thinking more along the ways of doing it using a script, I need to be able to toggle between wire and textured.
     
  6. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Wireframe terrain rendering, among other goodies, is coming in a future Unity update.
     
  7. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Good to hear, can´t wait for an an update that will enable us to script the hell out of the terrain engine.