質問編集履歴
2
提示画像を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
![イメージ説明](45a8796353b35fa51c8dd8f321ca49ef.png)
|
12
12
|
|
13
13
|
![イメージ説明](753dca4a8b8c31253e44c8d6a32590c6.png)
|
14
14
|
|
1
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
画像は提示コードのangle 変数部の数値0の場合とそうじゃない場合の画像です。
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
![イメージ説明](753dca4a8b8c31253e44c8d6a32590c6.png)
|
14
|
+
|
15
|
+
![イメージ説明](24222a87972cd9063b07e79b9dcebfe6.png)
|
16
|
+
|
5
17
|
|
6
18
|
|
7
19
|
このコードで原点を真ん中にずらしたものを変数mに入れてその行列をvecRotate分回転させて値がrorate変数格納という処理なのでがこの処理で
|
@@ -16,15 +28,7 @@
|
|
16
28
|
|
17
29
|
```
|
18
30
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
![イメージ説明](a1f76f5a8ff3b9f8d3f705f0ac9bfb76.png)
|
26
|
-
|
27
|
-
```
|
31
|
+
```ここに言語を入力
|
28
32
|
|
29
33
|
#include "DrawTest_2D.hpp"
|
30
34
|
|
@@ -130,13 +134,13 @@
|
|
130
134
|
|
131
135
|
vecScale = glm::vec3(size.x, size.y, 1.0f); //拡大縮小
|
132
136
|
|
133
|
-
vecRotate = glm::vec3(
|
137
|
+
vecRotate = glm::vec3(0.0f, 0.0f, -1.0f); //回転
|
134
|
-
|
138
|
+
|
135
|
-
angle = 0.0f; //回転量
|
139
|
+
angle = 20.0f; //回転量
|
136
140
|
|
137
141
|
vecTranslate = glm::vec3(0.0f, 0.0f, 0.0f); //平行移動
|
138
142
|
|
139
|
-
|
143
|
+
|
140
144
|
|
141
145
|
//モデル行列
|
142
146
|
|
@@ -146,15 +150,61 @@
|
|
146
150
|
|
147
151
|
glm::mat4 m = glm::translate(translate, glm::vec3(size.x * 0.5f, size.y * 0.5f,0)); //平行移動
|
148
152
|
|
153
|
+
|
154
|
+
|
155
|
+
std::cout << "m 行列" << std::endl;
|
156
|
+
|
157
|
+
std::cout << m[0].x << " , " << m[0].y << " , " << m[0].z << " , " << m[0].w << std::endl;
|
158
|
+
|
159
|
+
std::cout << m[1].x << " , " << m[1].y << " , " << m[1].z << " , " << m[1].w << std::endl;
|
160
|
+
|
161
|
+
std::cout << m[2].x << " , " << m[2].y << " , " << m[2].z << " , " << m[2].w << std::endl;
|
162
|
+
|
163
|
+
std::cout << m[3].x << " , " << m[3].y << " , " << m[3].z << " , " << m[3].w << std::endl;
|
164
|
+
|
165
|
+
std::cout << std::endl;
|
166
|
+
|
167
|
+
std::cout << std::endl;
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
149
177
|
rotate = glm::rotate(m,angle, vecRotate); //回転
|
150
178
|
|
179
|
+
|
180
|
+
|
181
|
+
std::cout << "rotate 行列" << std::endl;
|
182
|
+
|
183
|
+
std::cout << rotate[0].x << " , " << rotate[0].y << " , " << rotate[0].z << " , " << rotate[0].w << std::endl;
|
184
|
+
|
185
|
+
std::cout << rotate[1].x << " , " << rotate[1].y << " , " << rotate[1].z << " , " << rotate[1].w << std::endl;
|
186
|
+
|
187
|
+
std::cout << rotate[2].x << " , " << rotate[2].y << " , " << rotate[2].z << " , " << rotate[2].w << std::endl;
|
188
|
+
|
189
|
+
std::cout << rotate[3].x << " , " << rotate[3].y << " , " << rotate[3].z << " , " << rotate[3].w << std::endl;
|
190
|
+
|
191
|
+
std::cout << std::endl;
|
192
|
+
|
193
|
+
std::cout << std::endl;
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
151
201
|
//translate = glm::translate(translate, vecTranslate); //平行移動
|
152
202
|
|
153
203
|
|
154
204
|
|
155
205
|
scale = glm::scale(glm::mat4(1), vecScale); //拡大縮小
|
156
206
|
|
157
|
-
|
207
|
+
|
158
208
|
|
159
209
|
//ビュー
|
160
210
|
|
@@ -274,6 +324,8 @@
|
|
274
324
|
|
275
325
|
|
276
326
|
|
327
|
+
|
328
|
+
|
277
329
|
```glsl
|
278
330
|
|
279
331
|
/*#########################################################################
|