mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-14 17:33: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,10 +187,13 @@ std::string vertex::printVertex(bool rotate_x_90) const
|
|||
return s;
|
||||
}
|
||||
|
||||
std::string vertex::printNormal() const
|
||||
std::string vertex::printNormal(bool rotate_x_90) const
|
||||
{
|
||||
string s;
|
||||
s = "vn " + to_string(-normal.x) + " " + to_string(normal.y) + " " + to_string(-normal.z);
|
||||
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);
|
||||
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 += "\n";
|
||||
for (auto &v : vertices)
|
||||
s += v.printNormal() + "\n";
|
||||
s += v.printNormal(rotate_x_90) + "\n";
|
||||
s += "\n";
|
||||
for (auto &v : vertices)
|
||||
s += v.printTex() + "\n";
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ struct vertex
|
|||
void load(const buffer &b, uint32_t flags);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue