Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __MODEL_H__
- #define __MODEL_H__
- #include <vector>
- #include "tgaimage.h"
- #include "geometry.h"
- #include "SimpleMath.h"
- using namespace DirectX::SimpleMath;
- class Model {
- private:
- std::vector<Vector3> verts_;
- std::vector<std::vector<Vec3i> > faces_; // attention, this Vec3i means vertex/uv/normal
- std::vector<Vector3> norms_;
- std::vector<Vector2> uv_;
- TGAImage diffusemap_;
- TGAImage specularmap_;
- TGAImage normalmap_;
- void load_texture(std::string filename, const char* suffix, TGAImage& img);
- public:
- Model(const char* filename);
- ~Model();
- int nverts();
- int nfaces();
- Vector3 vert(int i);
- Vec2i uv(int iface, int nvert);
- TGAColor diffuse(Vec2i uv);
- std::vector<int> face(int idx);
- float specular(Vector3 uvf);
- Vector3 normal(int iface, int nthvert);
- Vector3 vert(int iface, int nthvert);
- };
- #endif //__MODEL_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement