mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-15 01:43:25 +00:00
Rotate normals also.
This commit is contained in:
parent
26f276ff94
commit
3ae21d2eca
2 changed files with 7 additions and 4 deletions
|
|
@ -187,9 +187,12 @@ std::string vertex::printVertex(bool rotate_x_90) const
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string vertex::printNormal() const
|
std::string vertex::printNormal(bool rotate_x_90) const
|
||||||
{
|
{
|
||||||
string s;
|
string s;
|
||||||
|
if (rotate_x_90)
|
||||||
|
s = "vn " + to_string(-normal.x) + " " + to_string(-normal.z) + " " + to_string(normal.y);
|
||||||
|
else
|
||||||
s = "vn " + to_string(-normal.x) + " " + to_string(normal.y) + " " + to_string(-normal.z);
|
s = "vn " + to_string(-normal.x) + " " + to_string(normal.y) + " " + to_string(-normal.z);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
@ -305,7 +308,7 @@ std::string block::printObj(int group_offset, bool rotate_x_90) const
|
||||||
s += v.printVertex(rotate_x_90) + "\n";
|
s += v.printVertex(rotate_x_90) + "\n";
|
||||||
s += "\n";
|
s += "\n";
|
||||||
for (auto &v : vertices)
|
for (auto &v : vertices)
|
||||||
s += v.printNormal() + "\n";
|
s += v.printNormal(rotate_x_90) + "\n";
|
||||||
s += "\n";
|
s += "\n";
|
||||||
for (auto &v : vertices)
|
for (auto &v : vertices)
|
||||||
s += v.printTex() + "\n";
|
s += v.printTex() + "\n";
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ struct vertex
|
||||||
void load(const buffer &b, uint32_t flags);
|
void load(const buffer &b, uint32_t flags);
|
||||||
|
|
||||||
std::string printVertex(bool rotate_x_90 = false) const;
|
std::string printVertex(bool rotate_x_90 = false) const;
|
||||||
std::string printNormal() const;
|
std::string printNormal(bool rotate_x_90 = false) const;
|
||||||
std::string printTex() const;
|
std::string printTex() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue