- Home /
GL not drawing in 3D?
I want to draw a 3d triangle using GL, but for some reason my code will always draw at y=0. This is a modified script of the available example on the unity manual.
void DrawTriangleGL(Vector3 A, Vector3 B, Vector3 C, Colorcolor)
{
material.SetPass(0);
GL.PushMatrix();
GL.MultMatrix(UnityEngine.Matrix4x4.identity);
GL.Begin(UnityEngine.GL.TRIANGLES);
GL.Color(color);
GL.Vertex3(A.x, A.y, A.z);
GL.Vertex3(B.x, B.y, B.z);
GL.Vertex3(C.x, C.y, C.z);
GL.End();
GL.PopMatrix();
}
What am i doing wrong?
Comment