I am experimenting with the Unity’s GL library of functions. I am just trying to rotate a line by X degrees.
I Know in openGL it would be something like this:
GL.Vertex3( 0, 0, 0 );
GL.Vertex3( 0, size, 0 );
Then to rotate I’d do
GLRotate(0,0,angle)
and repeat the code
GL.Vertex3( 0, 0, 0 );
GL.Vertex3( 0, size, 0 );
I can’t find any function similar to this with unity except using matrices so I wrote this, but it doesn’t rotate:
GL.Vertex3( 0, 0, 0 );
GL.Vertex3( 0, size, 0 );
Matrix4x4 m = Matrix4x4.TRS(Vector3.zero,Quaternion.Euler(0,0,angle),Vector3.one);
GL.MultMatrix( m);
GL.Vertex3( 0, 0, 0 );
GL.Vertex3( 0, size, 0 );
Any help would be awesome thanks.