1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:47:34 +00:00

3DFileViewer: Support textured models

Models that contain UV co-ordinates are now supported,
and will display with a texture wrapped around it, provided
a `bmp` with the same name as the object is in the same
directory as the 3D Model.
This commit is contained in:
Jesse Buhagiar 2021-05-23 23:57:53 +10:00 committed by Ali Mohammad Pur
parent 3287709df9
commit 343e66b816
7 changed files with 13657 additions and 9899 deletions

View file

@ -16,7 +16,7 @@ class Mesh : public RefCounted<Mesh> {
public:
Mesh() = delete;
Mesh(Vector<Vertex> vertices, Vector<Triangle> triangles);
Mesh(Vector<Vertex> vertices, Vector<TexCoord> tex_coords, Vector<Triangle> triangles);
size_t vertex_count() const { return m_vertex_list.size(); }
@ -24,7 +24,10 @@ public:
void draw();
bool is_textured() const { return m_tex_coords.size() > 0; }
private:
Vector<Vertex> m_vertex_list;
Vector<TexCoord> m_tex_coords;
Vector<Triangle> m_triangle_list;
};