I’m trying to draw simple, colored, flat triangles using three 3d coordinates, how would I do this? After some searching I came across this library “GL” which seems to do what I want, but I cannot get it to work. After reading the script reference I tried to make this script which runs in a simple cube gameobject:
using UnityEngine;
using System.Collections;
public class drawProjection : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
GL.PushMatrix();
GL.Begin(GL.TRIANGLES);
GL.Color(Color.red);
GL.Vertex3(1,0,0);
GL.Vertex3(0,1,0);
GL.Vertex3(0,2,0);
GL.End();
GL.PopMatrix();
}
}
But it does nothing. I’m very new to Unity, and I don’t even understand much of the lingo in the script reference so I don’t know where to begin at learning about this.