title: My axes won't show up
body: <p>I'm trying to implement a class drawing a 3D indicator such as this one : <a href="https://i.stack.imgur.com/l632N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l632N.png" alt="enter image description here"></a></p>
  
  <p>indicating the current rotation of the camera by drawing each axis at every frame as if it was in 3D.</p>
  
  <p>However, when my code runs I just can't see anything being drawn. When I try to draw it in Update() nothing is appearing on the screen but I still can see "The axes have been drawn in Update" showing up in the console. I tried to do it in OnPostRender() but it doesn't seem to be triggered, "The axes have been drawn" doesn't show up in the console.</p>
  
  <p>What could I be doing wrong ?</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.IO;
  using UnityEngine.UI;
  
  public class AxesManager : MonoBehaviour {
  
     private static readonly int DEFAULT_AXIS_LENGTH = 100;
  
     private Material _xMaterial;
     private Material _yMaterial;
     private Material _zMaterial;
  
     private Vector3 _origin;
     private int _length;
  
  
     // Use this for initialization
     void Start () {
         UpdateMaterials();
         _origin = GetAxesOrigin();
         _length = DEFAULT_AXIS_LENGTH;
     }
  
     // Update is called once per frame
     void Update () {
        //ClearAxes();
        //DrawAxes();
        //Debug.Log("The axes have been drawn in Update");
     }
  
     void OnPostRender()
     {
         DrawAxes();
         Debug.Log("The axes have been drawn");
     }
  
     private void DrawAxes()
     {
         //draw x axis
         GL.PushMatrix();
         GL.MultMatrix(transform.localToWorldMatrix);
         _xMaterial.SetPass(0);
         GL.LoadOrtho();
         GL.Begin(GL.LINES);
         GL.Color(Color.green);
         GL.Vertex(_origin);
         GL.Vertex(new Vector3(_length, 0, 0));
         GL.End();
         GL.PopMatrix();
  
         //draw y axis
         GL.PushMatrix();
         GL.MultMatrix(transform.localToWorldMatrix);
         _yMaterial.SetPass(0);
         GL.LoadOrtho();
         GL.Begin(GL.LINES);
         GL.Color(Color.red);
         GL.Vertex(_origin);
         GL.Vertex(new Vector3(0, _length, 0));
         GL.End();
         GL.PopMatrix();
  
         //draw z axis
         GL.PushMatrix();
         GL.MultMatrix(transform.localToWorldMatrix);
         _zMaterial.SetPass(0);
         GL.LoadOrtho();
         GL.Begin(GL.LINES);
         GL.Color(Color.blue);
         GL.Vertex(_origin);
         GL.Vertex(new Vector3(0, 0, _length));
         GL.End();
         GL.PopMatrix();
  
     }
  
     private void ClearAxes()
     {
         //clear the axes here
     }
  
     private Vector3 GetAxesOrigin()
     {
         return new Vector3(100,100,0);
     }
  
     private void UpdateMaterials()
     {
         _xMaterial = Resources.Load("Materials" + Path.DirectorySeparatorChar + "XAxisMaterial", typeof(Material)) as Material;
         _yMaterial = Resources.Load("Materials" + Path.DirectorySeparatorChar + "YAxisMaterial", typeof(Material)) as Material;
         _zMaterial = Resources.Load("Materials" + Path.DirectorySeparatorChar + "ZAxisMaterial", typeof(Material)) as Material;
     }
  }
  </code></pre>
  
  <p>EDIT : After having attached the script to a camera (rendering the top layer), I can now see OnPostRender() being triggered, but nothing shows up and no errors. What could it be ?</p>