<?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=423640&amp;view=findpost&amp;p=3853174</guid>
        <pubDate>Tue, 19 Oct 2021 12:41:29 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853174</link>
        <description><![CDATA[F0X: Все работает )]]></description>
        <author>F0X</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853134</guid>
        <pubDate>Mon, 18 Oct 2021 13:10:54 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853134</link>
        <description><![CDATA[Mikle: Вся логика очень короткая, она тут:<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">Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)</div><div class="code_line">&nbsp;&nbsp;If Button = 1 Then</div><div class="code_line">&nbsp;&nbsp; &nbsp;MX0 = x</div><div class="code_line">&nbsp;&nbsp; &nbsp;MY0 = y</div><div class="code_line">&nbsp;&nbsp;End If</div><div class="code_line">End Sub</div><div class="code_line">&nbsp;</div><div class="code_line">Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)</div><div class="code_line">&nbsp;&nbsp;Dim v As D3DVECTOR</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;If Button = 1 Then</div><div class="code_line">&nbsp;&nbsp; &nbsp;AngleX = (y - MY0) * -0.01</div><div class="code_line">&nbsp;&nbsp; &nbsp;AngleY = (x - MX0) * -0.01</div><div class="code_line">&nbsp;&nbsp; &nbsp;v = Vec3(AngleX, AngleY, 0)</div><div class="code_line">&nbsp;&nbsp; &nbsp;MatrixRotationAxis mRot, v, Vec3Length(v)</div><div class="code_line">&nbsp;&nbsp; &nbsp;MatrixMultiply mRot, mWorld, mRot</div><div class="code_line">&nbsp;&nbsp; &nbsp;Dev.SetTransform D3DTS_WORLD, mRot</div><div class="code_line">&nbsp;&nbsp;End If</div><div class="code_line">End Sub</div><div class="code_line">&nbsp;</div><div class="code_line">Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)</div><div class="code_line">&nbsp;&nbsp;If Button = 1 Then</div><div class="code_line">&nbsp;&nbsp; &nbsp;mWorld = mRot</div><div class="code_line">&nbsp;&nbsp;End If</div><div class="code_line">End Sub</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Mikle</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853126</guid>
        <pubDate>Mon, 18 Oct 2021 12:50:36 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853126</link>
        <description><![CDATA[F0X: Спасибо]]></description>
        <author>F0X</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853125</guid>
        <pubDate>Mon, 18 Oct 2021 12:30:40 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853125</link>
        <description><![CDATA[Mikle: Вот наиболее простой вариант.<br>
<br>
<span class="b-attach" data-size="40258" data-hits="163" data-attach-id="63093" data-attach-post-id="0">
			<span class="b-attach__title"></span><a class='b-attach-link' href='https://forum.sources.ru/index.php?act=Attach&amp;type=post&amp;id=0&amp;attach_id=63093' title='Скачать файл' target='_blank'>Teapot.zip</a> (, : 163)
		</span>]]></description>
        <author>Mikle</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853117</guid>
        <pubDate>Mon, 18 Oct 2021 10:21:26 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853117</link>
        <description><![CDATA[Mikle: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=423640&view=findpost&p=3853116'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>F0X &#064; <time class="tag-quote__quoted-time" datetime="2021-10-18T09:40:24+00:00">18.10.21, 09:40</time></span><div class='quote '>можете маленький участок кода на VB и Direct3D привести</div></div><br>
Сделаю чуть позже.]]></description>
        <author>Mikle</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853116</guid>
        <pubDate>Mon, 18 Oct 2021 09:40:24 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853116</link>
        <description><![CDATA[F0X: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>просто я работаю с Direct3D</div></div><br>
<strong class='tag-b'>Mikle</strong> можете маленький участок кода на VB и Direct3D привести как от матриц перейти к командам аналогичным типа glRotatef() я переведу на Си и OpenGL.]]></description>
        <author>F0X</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853115</guid>
        <pubDate>Mon, 18 Oct 2021 09:22:44 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853115</link>
        <description><![CDATA[Mikle: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=423640&view=findpost&p=3853105'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>F0X &#064; <time class="tag-quote__quoted-time" datetime="2021-10-18T08:08:31+00:00">18.10.21, 08:08</time></span><div class='quote '> в положении (1) оси x-y-z уже не перпендикулярны и не параллельны окну пользователя </div></div><br>
Это исправляется порядком умножения матриц.<br>
М1 - матрица, на которую уже повёрнут объект.<br>
М2 - матрица, на которую нужно довернуть объект.<br>
Можно умножать двумя способами:<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">М1=М1*М2</div><div class="code_line">М1=М2*М1</div></ol></div></div></div></div><br>
В одном случае будет доворот вокруг мировых осей X и Y, во другом вокруг локальных осей объекта.]]></description>
        <author>Mikle</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853103</guid>
        <pubDate>Mon, 18 Oct 2021 07:47:21 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853103</link>
        <description><![CDATA[Mikle: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=423640&view=findpost&p=3853098'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>F0X &#064; <time class="tag-quote__quoted-time" datetime="2021-10-18T06:46:16+00:00">18.10.21, 06:46</time></span><div class='quote '>Есть координаты мыши момент нажатия клавиши x1,y1 и отпускание x2,y2<br>
Как зная эту информацию правильно задавать</div></div><br>
Нужно вычислять две матрицы:<br>
одна - от перемещения мыши по X зависит вращение камеры вокруг Z,<br>
а вторая - от перемещения мыши по Y зависит вращение камеры вокруг X.<br>
Далее перемножаем матрицы и получаем матрицу для камеры, важно соблюсти правильный порядок перемножения матриц, не скажу какой именно - просто я работаю с Direct3D, там немного по-другому, для OpenGL может не подойти. Но там всего два варианта, проверь.]]></description>
        <author>Mikle</author>
        <category>Программирование графики</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853098</guid>
        <pubDate>Mon, 18 Oct 2021 06:46:16 +0000</pubDate>
        <title>Вращение 3D объекта с помощью мыши</title>
        <link>https://forum.sources.ru/index.php?showtopic=423640&amp;view=findpost&amp;p=3853098</link>
        <description><![CDATA[F0X: Как с помощью мыши вращать трехмерный объект.<br>( Имеется ввиду так же как это сделано в CAD системах )]]></description>
        <author>F0X</author>
        <category>Программирование графики</category>
      </item>
	
      </channel>
      </rss>
	