You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for your code!
I have been using it to create a convex hull for speakers in an immersive sound system. I have given the relevant code below, and also the DBG output - apologies for the long listing. My concern is that triangles, indicated by the indices, are often not on the surface of the hull. Could I be doing something wrong? Speaker coords are in meters.
In header: QuickHull<float> qh; std::vector<Vector3<float>> vertices; ConvexHull<FloatType> faces;
Part of code:
` for (int i = 0; i < noSpeakers; i++) {
vertices.emplace_back(speakers[i]->x, speakers[i]->y, speakers[i]->z);
}
DBG("Speakers";
for (int i = 0; i < noSpeakers; i++) {
DBG(i);
DBG(vertices[i].x);
DBG(vertices[i].y);
DBG(vertices[i].z);
}
DBG("size of vertices");
DBG(vertices.size());
faces = qh.getConvexHull(vertices, true, false);
const auto& indexBuffer = faces.getIndexBuffer();
const auto& vertexBuffer = faces.getVertexBuffer();
DBG("Index Buffer");
for (int i = 0; i < indexBuffer.size(); i=(i+3)) {
DBG(indexBuffer[i]);
DBG(indexBuffer[i+1]);
DBG(indexBuffer[i+2]);
DBG(" ");
}`
Hi, thank you for your code!
I have been using it to create a convex hull for speakers in an immersive sound system. I have given the relevant code below, and also the DBG output - apologies for the long listing. My concern is that triangles, indicated by the indices, are often not on the surface of the hull. Could I be doing something wrong? Speaker coords are in meters.
In header:
QuickHull<float> qh; std::vector<Vector3<float>> vertices; ConvexHull<FloatType> faces;
Part of code:
` for (int i = 0; i < noSpeakers; i++) {
vertices.emplace_back(speakers[i]->x, speakers[i]->y, speakers[i]->z);
}
DBG("Speakers";
for (int i = 0; i < noSpeakers; i++) {
DBG(i);
DBG(vertices[i].x);
DBG(vertices[i].y);
DBG(vertices[i].z);
}
Speakers
Speaker:
0
4
1.77
Speaker:
9.60067e-09
3.89018
4.14666
Speaker:
-2
3.46
1.77
Speaker:
2
3.46
1.77
Speaker:
-1.94509
3.36489
4.14666
Speaker:
1.94509
3.36489
4.14666
Speaker:
-3.76
-1.37
1.77
Speaker:
3.76
-1.37
1.77
Speaker:
-3.6568
-1.33244
4.14666
Speaker:
3.6568
-1.33244
4.14666
Speaker:
2
-3.46
1.77
Speaker:
-2
-3.46
1.77
Speaker:
0
0.27
4.2
size of vertices
13
Index Buffer
0
2
1
1
2
3
3
2
4
2
5
4
5
6
4
6
3
4
6
7
3
7
1
3
7
0
1
0
7
8
8
7
9
7
6
9
9
6
10
6
5
10
5
11
10
11
9
10
11
8
9
8
11
12
11
0
12
0
8
12
0
11
2
2
11
5
The text was updated successfully, but these errors were encountered: