-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometryGenerator.cpp
More file actions
executable file
·538 lines (427 loc) · 15.9 KB
/
GeometryGenerator.cpp
File metadata and controls
executable file
·538 lines (427 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
#include "GeometryGenerator.h"
#include "MathHelper.h"
/// <summary>
/// 根据传入的宽高和深度创建一个原点在中心的矩形体
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateBox(float width,float height,float depth,MeshData& meshData)
{
Vertex v[24];
float w2 = 0.5f*width;
float h2 = 0.5f*height;
float d2 = 0.5f*depth;
// Fill in the front face vertex data.
v[0] = Vertex(-w2, -h2, -d2, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
v[1] = Vertex(-w2, +h2, -d2, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[2] = Vertex(+w2, +h2, -d2, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[3] = Vertex(+w2, -h2, -d2, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f);
// Fill in the back face vertex data.
v[4] = Vertex(-w2, -h2, +d2, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f);
v[5] = Vertex(+w2, -h2, +d2, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
v[6] = Vertex(+w2, +h2, +d2, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[7] = Vertex(-w2, +h2, +d2, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
// Fill in the top face vertex data.
v[8] = Vertex(-w2, +h2, -d2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
v[9] = Vertex(-w2, +h2, +d2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[10] = Vertex(+w2, +h2, +d2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[11] = Vertex(+w2, +h2, -d2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f);
// Fill in the bottom face vertex data.
v[12] = Vertex(-w2, -h2, -d2, 0.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f);
v[13] = Vertex(+w2, -h2, -d2, 0.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
v[14] = Vertex(+w2, -h2, +d2, 0.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[15] = Vertex(-w2, -h2, +d2, 0.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
// Fill in the left face vertex data.
v[16] = Vertex(-w2, -h2, +d2, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f);
v[17] = Vertex(-w2, +h2, +d2, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f);
v[18] = Vertex(-w2, +h2, -d2, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f);
v[19] = Vertex(-w2, -h2, -d2, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f);
// Fill in the right face vertex data.
v[20] = Vertex(+w2, -h2, -d2, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f);
v[21] = Vertex(+w2, +h2, -d2, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
v[22] = Vertex(+w2, +h2, +d2, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f);
v[23] = Vertex(+w2, -h2, +d2, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
meshData.Vertices.assign(&v[0],&v[24]);
UINT i[36];
// Fill in the front face index data
i[0] = 0; i[1] = 1; i[2] = 2;
i[3] = 0; i[4] = 2; i[5] = 3;
// Fill in the back face index data
i[6] = 4; i[7] = 5; i[8] = 6;
i[9] = 4; i[10] = 6; i[11] = 7;
// Fill in the top face index data
i[12] = 8; i[13] = 9; i[14] = 10;
i[15] = 8; i[16] = 10; i[17] = 11;
// Fill in the bottom face index data
i[18] = 12; i[19] = 13; i[20] = 14;
i[21] = 12; i[22] = 14; i[23] = 15;
// Fill in the left face index data
i[24] = 16; i[25] = 17; i[26] = 18;
i[27] = 16; i[28] = 18; i[29] = 19;
// Fill in the right face index data
i[30] = 20; i[31] = 21; i[32] = 22;
i[33] = 20; i[34] = 22; i[35] = 23;
meshData.Indices.assign(&i[0],&i[36]);
}
/// <summary>
/// 创建一个球体,sliceCount和stackCount控制曲面细分的程度(类似精度和纬度)
/// </summary>
/// <param name="radis">球体的半径</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateSphere(float radius, UINT sliceCount,UINT stackCount,MeshData& meshData)
{
meshData.Vertices.clear();
meshData.Indices.clear();
Vertex topVertex(0.0f,radius,0.0f,0.0f,1.0f,0.0f,1.0f,0.0f,0.0f,0.0f,0.0f);
Vertex bottomVertex(0.0f,-radius,0.0f,0.0f,-1.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f);
meshData.Vertices.push_back(topVertex);
float phiStep = XM_PI/stackCount;
float thetaStep = 2.0f*XM_PI/sliceCount;
for(UINT i = 1; i <= stackCount-1;++i)
{
float phi = i*phiStep;
for (UINT j = 0; j <= sliceCount; ++j)
{
float theta = j*thetaStep;
Vertex v;
v.Position.x = radius*sinf(phi)*cosf(theta);
v.Position.y = radius*cosf(phi);
v.Position.z = radius*sinf(phi)*sinf(theta);
//切线,叉积为0
v.TangentU.x = -radius*sinf(phi)*sinf(theta);
v.TangentU.y = 0.0f;
v.TangentU.z = radius*sinf(phi)*cosf(theta);
//单位化切线向量
XMVECTOR T = XMLoadFloat3(&v.TangentU);
XMStoreFloat3(&v.TangentU,XMVector3Normalize(T));
//坐标为原点,作为一个圆,法线就是到点的向量
XMVECTOR p = XMLoadFloat3(&v.Position);
XMStoreFloat3(&v.Normal,XMVector3Normalize(p));
v.TexC.x = theta/XM_2PI;
v.TexC.y = phi / XM_PI;
meshData.Vertices.push_back(v);
}
}
meshData.Vertices.push_back(bottomVertex);
//为顶部的环计算索引值。
for (UINT i = 0; i <= sliceCount ; i++)
{
meshData.Indices.push_back(0);
meshData.Indices.push_back(i+1);
meshData.Indices.push_back(i);
}
UINT baseIndex = 1;
//每一圈的切片数量
UINT ringVertexCount = sliceCount+1;
for (UINT i = 0; i < stackCount-2; i++)
{
for (UINT j = 0; j < sliceCount; j++)
{
meshData.Indices.push_back(baseIndex + i*ringVertexCount +j);
meshData.Indices.push_back(baseIndex+i*ringVertexCount + j+1);
meshData.Indices.push_back(baseIndex+(i+1)*ringVertexCount + j);
meshData.Indices.push_back(baseIndex + (i+1)*ringVertexCount+j);
meshData.Indices.push_back(baseIndex+i*ringVertexCount+j+1);
meshData.Indices.push_back(baseIndex+(i+1)*ringVertexCount+j+1);
}
}
//将最后一圈的索引放进数组
UINT soutPoleIndex = (UINT)meshData.Vertices.size()-1;
baseIndex = soutPoleIndex - ringVertexCount;
for (UINT i = 0; i < sliceCount; i++)
{
meshData.Indices.push_back(soutPoleIndex);
meshData.Indices.push_back(baseIndex+i);
meshData.Indices.push_back(baseIndex+i+1);
}
}
/// <summary>
/// 细分,用三个点产生6个点
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::Subdivide(MeshData& meshData)
{
//保存一个输入数据的备份
MeshData inputCopy = meshData;
meshData.Vertices.resize(0);
meshData.Indices.resize(0);
// v1
// *
// / \
// / \
// m0*-----*m1
// / \ / \
// / \ / \
// *-----*-----*
// v0 m2 v2
UINT numTris = inputCopy.Indices.size()/3;
for (UINT i = 0; i < numTris; i++)
{
Vertex v0 = inputCopy.Vertices[inputCopy.Indices[i*3+0]];
Vertex v1 = inputCopy.Vertices[inputCopy.Indices[i*3+1]];
Vertex v2 = inputCopy.Vertices[inputCopy.Indices[i*3+2]];
Vertex m0,m1,m2;
m0.Position = XMFLOAT3(0.5f*(v0.Position.x+v1.Position.x),0.5f*(v0.Position.y+v1.Position.y),0.5f*(v0.Position.z+v1.Position.z));
m1.Position = XMFLOAT3(0.5f*(v2.Position.x+v1.Position.x),0.5f*(v2.Position.y+v1.Position.y),0.5f*(v2.Position.z+v1.Position.z));
m2.Position = XMFLOAT3(0.5f*(v0.Position.x+v2.Position.x),0.5f*(v0.Position.y+v2.Position.y),0.5f*(v0.Position.z+v2.Position.z));
meshData.Vertices.push_back(v0);
meshData.Vertices.push_back(v1);
meshData.Vertices.push_back(v2);
meshData.Vertices.push_back(m0);
meshData.Vertices.push_back(m1);
meshData.Vertices.push_back(m2);
meshData.Indices.push_back(i*6+0);
meshData.Indices.push_back(i*6+3);
meshData.Indices.push_back(i*6+5);
meshData.Indices.push_back(i*6+3);
meshData.Indices.push_back(i*6+4);
meshData.Indices.push_back(i*6+5);
meshData.Indices.push_back(i*6+5);
meshData.Indices.push_back(i*6+4);
meshData.Indices.push_back(i*6+2);
meshData.Indices.push_back(i*6+3);
meshData.Indices.push_back(i*6+1);
meshData.Indices.push_back(i*6+4);
}
}
/// <summary>
/// 创建一个椭圆
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateGeosphere(float radius, UINT numSubdivisions, MeshData& meshData)
{
numSubdivisions = MathHelper::Min(numSubdivisions,5u);
const float X = 0.525731f;
const float Z = 0.850651f;
XMFLOAT3 pos[12] =
{
XMFLOAT3(-X,0.0f,Z),XMFLOAT3(X,0.0f,Z),
XMFLOAT3(-X,0.0f,-Z),XMFLOAT3(X,0.0f,-Z),
XMFLOAT3(0.0f,Z,X),XMFLOAT3(0.0f,Z,-X),
XMFLOAT3(0.0f,-Z,X),XMFLOAT3(0.0f,-Z,-X),
XMFLOAT3(Z,X,0.0f),XMFLOAT3(-Z,X,0.0f),
XMFLOAT3(Z,-X,0.0f),XMFLOAT3(-Z,-X,0.0f)
};
DWORD k[60] =
{
1,4,0, 4,9,0, 4,5,9, 8,5,4, 1,8,4,
1,10,8, 10,3,8, 8,3,5, 3,2,5, 3,7,2,
3,10,7, 10,6,7, 6,11,7, 6,0,11, 6,1,0,
10,1,6, 11,0,9, 2,11,9, 5,2,9, 11,2,7
};
meshData.Vertices.resize(12);
meshData.Indices.resize(20);
for (UINT i = 0; i < 12; i++)
{
meshData.Vertices[i].Position = pos[i];
}
for (UINT i = 0; i < 60; i++)
{
meshData.Indices[i] = k[i];
}
for (UINT i = 0; i < meshData.Vertices.size(); i++)
{
XMVECTOR n = XMVector3Normalize(XMLoadFloat3(&meshData.Vertices[i].Position));
XMVECTOR p = radius*n;
XMStoreFloat3(&meshData.Vertices[i].Position,p);
XMStoreFloat3(&meshData.Vertices[i].Normal,n);
float theta = MathHelper::AngleFromXY(meshData.Vertices[i].Position.x,meshData.Vertices[i].Position.z);
float phi = acosf(meshData.Vertices[i].Position.y / radius);
meshData.Vertices[i].TexC.x = theta/XM_2PI;
meshData.Vertices[i].TexC.y = phi/XM_2PI;
meshData.Vertices[i].TangentU.x = -radius*sinf(phi)*cosf(theta);
meshData.Vertices[i].TangentU.y = 0.0f;
meshData.Vertices[i].TangentU.z = radius*sinf(phi)*cosf(theta);
XMVECTOR T = XMLoadFloat3(&meshData.Vertices[i].TangentU);
XMStoreFloat3(&meshData.Vertices[i].TangentU,XMVector3Normalize(T));
}
}
/// <summary>
/// 创建一个圆柱体
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateCylinder(float bottomRadius,float topRadius,float height,UINT sliceCount,UINT stackCount,MeshData& meshData)
{
meshData.Vertices.clear();
meshData.Indices.clear();
float stackHeight = height/stackCount;
float radiusStep = (topRadius-bottomRadius)/stackCount;
UINT ringCount = stackCount + 1;
for (UINT i = 0; i < ringCount; i++)
{
float y = -0.5f*height + i*stackHeight;
float r = bottomRadius + i*radiusStep;
float dTheta = 2.0f*XM_PI/sliceCount;
for (UINT j = 0; j <= sliceCount; j ++)
{
Vertex vertex;
float c = cosf(j*dTheta);
float s = sinf(j*dTheta);
vertex.Position = XMFLOAT3(r*c,y,r*s);
vertex.TexC.x = (float)j/sliceCount;
vertex.TexC.y = 1.0f - (float)i/stackCount;
vertex.TangentU = XMFLOAT3(-s,0.0f,c);
float dr = bottomRadius-topRadius;
//当前曲面上的向量
XMFLOAT3 bitangent(dr*c,-height,dr*s);
XMVECTOR T = XMLoadFloat3(&vertex.TangentU);
XMVECTOR B = XMLoadFloat3(&bitangent);
//切线和当前曲面的叉积就得到了法线。
XMVECTOR N = XMVector3Normalize(XMVector3Cross(T,B));
XMStoreFloat3(&vertex.Normal,N);
meshData.Vertices.push_back(vertex);
}
}
UINT ringVertexCount = sliceCount+1;
for (UINT i = 0; i < stackCount; i++)
{
for (int j = 0; j < sliceCount; j ++)
{
meshData.Indices.push_back(i*ringVertexCount+j);
meshData.Indices.push_back((i+1)*ringVertexCount+j);
meshData.Indices.push_back((i+1)*ringVertexCount+j+1);
meshData.Indices.push_back(i*ringVertexCount+j);
meshData.Indices.push_back((i+1)*ringVertexCount+j+1);
meshData.Indices.push_back(i*ringVertexCount+j+1);
}
}
BuildCylinderTopCap(bottomRadius,topRadius,height,sliceCount,stackCount,meshData);
BuildCylinderBottomCap(bottomRadius,topRadius,height,sliceCount,stackCount,meshData);
}
/// <summary>
/// 创建圆柱顶部的
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::BuildCylinderTopCap(float bottomRadius,float topRadius,float height, UINT sliceCount,UINT stackCount,MeshData& meshData)
{
UINT baseIndex = (UINT)meshData.Vertices.size();
float y = 0.5f*height;
float dTheta = 2.0f*XM_PI/sliceCount;
for (UINT i = 0; i <= sliceCount; i++)
{
float x = topRadius*cosf(i*dTheta);
float z = topRadius*sinf(i*dTheta);
//除以height来使得纹理看起来均匀
float u = x/height + 0.5f;
float v = z/height + 0.5f;
meshData.Vertices.push_back(Vertex(x,y,z,0.0f,1.0f,0.0f,1.0f,0.0f,0.0f,u,v));
}
//顶部中心点
meshData.Vertices.push_back(Vertex(0.0f,y,0.0f,0.0f,1.0f,0.0f,1.0f,0.0f,0.0f,0.5f,0.5f));
UINT centerIndex = (UINT)meshData.Vertices.size()-1;
for (UINT i = 0; i < sliceCount; i++)
{
meshData.Indices.push_back(centerIndex);
meshData.Indices.push_back(baseIndex+i+1);
meshData.Indices.push_back(baseIndex+i);
}
}
void GeometryGenerator::BuildCylinderBottomCap(float bottomRadius, float topRadius, float heigt,UINT sliceCount, UINT stackCount,MeshData& meshData)
{
UINT baseIndex = (UINT)meshData.Vertices.size();
float y = -0.5f*heigt;
float dTheta = 2.0f*XM_PI/sliceCount;
for (UINT i = 0; i <= sliceCount ; i++)
{
float x = bottomRadius*cosf(i*dTheta);
float z = bottomRadius*sinf(i*dTheta);
float u = x/heigt + 0.5f;
float v = z/heigt + 0.5f;
meshData.Vertices.push_back(Vertex(x,y,z,0.0f,-1.0f,0.0f,1.0f,0.0f,0.0f,u,v));
}
//顶部中心点
meshData.Vertices.push_back(Vertex(0.0f,y,0.0f,0.0f,-1.0f,0.0f,1.0f,0.0f,0.0f,0.5f,0.5f));
UINT centerIndex = (UINT)meshData.Vertices.size()-1;
for (UINT i = 0; i < sliceCount; i++)
{
meshData.Indices.push_back(centerIndex);
meshData.Indices.push_back(baseIndex+i);
meshData.Indices.push_back(baseIndex+i+1);
}
}
/// <summary>
/// 创建网格
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateGrid(float width,float depth, UINT m, UINT n, MeshData& meshData)
{
UINT vertexCount = m*n;
//面的数量
UINT faceCount = (m-1)*(n-1)*2;
float halfWidth = 0.5f*width;
float halfDepth = 0.5f*depth;
float dx = width/(n-1);
float dz = depth/(m-1);
float du = 1.0f/(n-1);
float dv = 1.0f/(m-1);
meshData.Vertices.resize(vertexCount);
for (UINT i = 0; i < m; i++)
{
float z = halfDepth - i*dz;
for (UINT j = 0; j < n; j ++)
{
float x = -halfWidth + j*dx;
meshData.Vertices[i*n+j].Position = XMFLOAT3(x,0.0f,z);
meshData.Vertices[i*n+j].Normal = XMFLOAT3(0.0f,1.0f,0.0f);
meshData.Vertices[i*n+j].TangentU = XMFLOAT3(1.0f,0.0f,0.0f);
meshData.Vertices[i*n+j].TexC.x = j*du;
meshData.Vertices[i*n+j].TexC.y = i*dv;
}
}
meshData.Indices.resize(faceCount*3);
UINT k = 0;
for (UINT i = 0; i < m-1; i++)
{
for (UINT j = 0; j < n-1; j++)
{
meshData.Indices[k] = i*n+j;
meshData.Indices[k+1] = i*n+j+1;
meshData.Indices[k+2] = (i+1)*n + j;
meshData.Indices[k+3] = (i+1)*n +j;
meshData.Indices[k+4] = i*n+j+1;
meshData.Indices[k+5] = (i+1)*n + j+ 1;
k+=6;
}
}
}
/// <summary>
/// 创建一个满屏的四方形
/// </summary>
/// <param name="Name of the parameter">Description</param>
/// <returns>Description of return value</returns>
void GeometryGenerator::CreateFullScreenQuad(MeshData& meshData)
{
meshData.Vertices.resize(4);
meshData.Indices.resize(6);
meshData.Vertices[0] = Vertex(
-1.0f, -1.0f, 0.0f,
0.0f, 0.0f, -1.0f,
1.0f, 0.0f, 0.0f,
0.0f, 1.0f);
meshData.Vertices[1] = Vertex(
-1.0f, +1.0f, 0.0f,
0.0f, 0.0f, -1.0f,
1.0f, 0.0f, 0.0f,
0.0f, 0.0f);
meshData.Vertices[2] = Vertex(
+1.0f, +1.0f, 0.0f,
0.0f, 0.0f, -1.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f);
meshData.Vertices[3] = Vertex(
+1.0f, -1.0f, 0.0f,
0.0f, 0.0f, -1.0f,
1.0f, 0.0f, 0.0f,
1.0f, 1.0f);
meshData.Indices[0] = 0;
meshData.Indices[1] = 1;
meshData.Indices[2] = 2;
meshData.Indices[3] = 0;
meshData.Indices[4] = 2;
meshData.Indices[5] = 3;
}