Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Draw field of view

Discussion in 'Editor & General Support' started by gnp89, Jun 25, 2012.

  1. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    I need to draw enemy's field of view as in the Commandos game series.
    I don't know how to solve this and have no idea where or how to start.
    Should I use a shader, draw a texture over the terrain, draw primitives, or what?
    Any aproach, ideas or links are welcome!
     
  2. ivanzu

    ivanzu

    Joined:
    Nov 25, 2010
    Posts:
    2,065
    Projectors
     
  3. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    Thank you I'll try that out!
     
  4. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    I'm not sure about using projectors for this. I need to draw the field of view over an irregluar terrain, and the field of views have different widths and view distances depending on the character. I made a first aproach drawing primitives with the GL class, but I draw triangles horizontally and I need them to project on to the terrain and its relief.
    Can you give me some more details on how to use projectors for this purpose? Do they really work for this? I've seen some simple examples and still don't get how to use them for this problem.