<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772936</guid>
        <pubDate>Wed, 27 Jun 2018 07:04:15 +0000</pubDate>
        <title>Окружность в OpenGL</title>
        <link>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772936</link>
        <description><![CDATA[agapa: Доброе время суток.<br>Спасибо за совет :thanks:]]></description>
        <author>agapa</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772669</guid>
        <pubDate>Fri, 22 Jun 2018 14:05:18 +0000</pubDate>
        <title>Окружность в OpenGL</title>
        <link>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772669</link>
        <description><![CDATA[Славян: В матрице модельного вида устанавливаются пропорции по Ox и Oy. Их надо учесть. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-06-22T14:09:40+00:00">22.06.18, 14:09</time></span></span><br>
П.С. функции <em class='tag-i'>glBegin</em>/<em class='tag-i'>glEnd</em> архимедленные, так что много лучше вынести их за <em class='tag-i'>while</em>.]]></description>
        <author>Славян</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772649</guid>
        <pubDate>Fri, 22 Jun 2018 06:41:28 +0000</pubDate>
        <title>Окружность в OpenGL</title>
        <link>https://forum.sources.ru/index.php?showtopic=413129&amp;view=findpost&amp;p=3772649</link>
        <description><![CDATA[agapa: Доброе время суток<br>
Не откажите в совете (хоть и тема, я думаю, заезжена :wacko: ).<br>
реализовал алгоритм средней точки, использование полярных функций считаю не АЙС&#33;&#33;&#33;&#33;<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">void CGraphScena2D::_circleMidlPoint(GLdouble r,GLdouble xc,GLdouble yc)</div><div class="code_line">{ &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp;GLdouble x,y,xk,yk;</div><div class="code_line">&nbsp;&nbsp; &nbsp;GLdouble p = 5/4 - r;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;//Переношу точку а начало координат</div><div class="code_line">&nbsp;&nbsp; &nbsp;x = 0; y = r;</div><div class="code_line">&nbsp;&nbsp; &nbsp;xk = x; yk = y;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;auto now = std::chrono::time_point_cast&#60;std::chrono::milliseconds&#62;(std::chrono::system_clock::now());</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;while (x &#60;= y)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xk += 0.1;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (p &#60; 0)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p += 2*x + 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p += 2*(x - y) + 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yk -= 0.1;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+x,yc+y);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+xk,yc+yk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-x,yc+y);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-xk,yc+yk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-y,yc+x);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-yk,yc+xk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-y,yc-x);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-yk,yc-xk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-x,yc-y);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc-xk,yc-yk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+x,yc-y);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+xk,yc-yk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+y,yc-x);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+yk,yc-xk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glBegin(GL_LINES);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+y,yc+x);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glVertex2d(xc+yk,yc+xk);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;glEnd();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;x = xk,y = yk;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;auto comm = (std::chrono::time_point_cast&#60;std::chrono::milliseconds&#62;(std::chrono::system_clock::now()) - now).count();</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;printf_s(&quot;Время отрисовки круга... - %f(секунд)\n&quot;,(double)(comm/1000.0));</div><div class="code_line">&nbsp;</div><div class="code_line">}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Но в результате отрисовывается элипс а не окружность.<br>
Что я сделал не корректно? :unsure:  Подскажите, пожалуйста.]]></description>
        <author>agapa</author>
        <category>Программирование графики</category>
      </item>
	
      </channel>
      </rss>
	