mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:33:35 +02:00
swap y and z coords because normal obj format has 3rd value as up
This commit is contained in:
parent
adfacf1e98
commit
d642b52de3
1 changed files with 2 additions and 7 deletions
|
@ -41,12 +41,6 @@ bool writeOBJ(QString outFileName, QVector<QVector<VHACD::IVHACD::ConvexHull>>&
|
|||
|
||||
QTextStream out(&file);
|
||||
|
||||
// if (meshList.size() != 1) {
|
||||
// qDebug() << "unexpected number of meshes --" << meshList.size();
|
||||
// exit(1);
|
||||
// }
|
||||
// QVector<VHACD::IVHACD::ConvexHull> hulls = meshList[0];
|
||||
|
||||
unsigned int pointStartOffset = 0;
|
||||
|
||||
foreach (QVector<VHACD::IVHACD::ConvexHull> hulls, meshList) {
|
||||
|
@ -56,8 +50,9 @@ bool writeOBJ(QString outFileName, QVector<QVector<VHACD::IVHACD::ConvexHull>>&
|
|||
for (unsigned int i = 0; i < hull.m_nPoints; i++) {
|
||||
out << "v ";
|
||||
out << formatFloat(hull.m_points[i*3]) << " ";
|
||||
// swap y and z because up is 3rd value in OBJ
|
||||
out << formatFloat(hull.m_points[i*3+2]) << "\n";
|
||||
out << formatFloat(hull.m_points[i*3+1]) << " ";
|
||||
out << formatFloat(hull.m_points[i*3+2]) << " 1\n";
|
||||
}
|
||||
for (unsigned int i = 0; i < hull.m_nTriangles; i++) {
|
||||
out << "f ";
|
||||
|
|
Loading…
Reference in a new issue