[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: plotted circle is regular decagon on opengl graphics
From: |
Tatsuro MATSUOKA |
Subject: |
Re: plotted circle is regular decagon on opengl graphics |
Date: |
Thu, 11 Aug 2016 17:37:13 +0900 (JST) |
----- Original Message -----
> From: Andreas Weber
> To: Tatsuro MATSUOKA ; "octave-maintainers
> Cc:
> Date: 2016/8/11, Thu 17:12
> Subject: Re: plotted circle is regular decagon on opengl graphics
>
> Hi Tatsuro,
>
> Am 11.08.2016 um 08:17 schrieb Tatsuro MATSUOKA:
>> Graphics tool kit: qt and fltk
>> plot (1:1, 'o', 'markersize', 24)
>> print -depsc circle.eps
>> plotted circle is regular decagon (ugly).
>
> The code to draw the markers with OpenGL is in gl-render.cc
> opengl_renderer::make_marker_list
>
> case 'o':
> {
> double ang_step = M_PI / 5;
>
> glBegin ((filled ? GL_POLYGON : GL_LINE_LOOP));
> for (double ang = 0; ang < (2*M_PI); ang += ang_step)
> glVertex2d (sz*cos (ang)/2, sz*sin (ang)/2);
> glEnd ();
> }
>
> As you can see the decagon is hardcoded. AFAIK there is no "draw
> circle"
> command in OpenGL so the only way to get a smoother circle would be to
> increase the numer of segments.
>
> -- Andy
Thank you for your comprehensive explanation and understand the situation.
I feel it is not smooth enough for relatively large size of circles.
However, increase of number of segments will be large size of file if number of
plot points becomes large.
Anyway I will use gnuplot graphics_toolkit if needed.
Tatsuro