I hope you can help me with a little problem…
I know how to draw a circle, that’s not a problem – here is the code in c#
void DrawEllipse()
{
GL.Color3(0.5, 0.6, 0.2);
float x, y, z;
double t;
GL.Begin(BeginMode.Points);
for (t = 0; t <= 360; t += 0.25)
{
x = (float)(3*Math.Sin(t));
y = (float)(3*Math.Cos(t));
z = (float)0;
GL.Vertex3(x, y, z);
}
GL.End();
}
But there is a problem – when I Rotate ‘Gl.Rotate(angle, axis)’ and then redraw a circle – yeah, it’s still circle in the 3D, but I want a circle in the screen – I mean static circle which is not rotating with 3D object in it… Is that possible? How to repair the code?
Just draw it at a position before the camera!
Use
pushMatrix()andpopMatrix().Or you can draw the other things between
pushMatrix()andpopMatrix(). Then draw the circle.