display all models from a mesh,

problem, apply different model matrices for each model,
solution give a list of all models to ogl controller, where they are handled,
next steps: find solution for wrong rotation + draw ALL models instead of only the first
This commit is contained in:
Anakin
2016-10-30 14:22:08 +01:00
parent a8bfacfd73
commit e509b1e11c
5 changed files with 153 additions and 37 deletions

View File

@@ -4,6 +4,7 @@
#include <fstream>
#include <string>
#include <gl\glew.h>
#include <glm\gtc\matrix_transform.hpp>
enum Mtyp {
null,
@@ -25,6 +26,7 @@ struct Modl {
std::string parent;
Mtyp type;
std::uint32_t renderFlags;
glm::mat4 m4x4Translation;
struct {
float scale[3];
float rotation[4];
@@ -52,7 +54,7 @@ public:
private:
std::list<Modl*> lModls;
std::vector<Modl*> vModls;
std::fstream fsMesh;
std::vector<std::string> vTextures;
@@ -73,7 +75,8 @@ private:
public:
std::vector<GLfloat> getVertex() const;
std::vector<GLfloat> getUV() const;
std::list<std::uint32_t> getSize() const;
std::uint32_t getSize() const;
std::list<std::string> getTexture() const;
std::vector<Modl*> getModels() const;
};

View File

@@ -4,6 +4,7 @@
#include <gl\glfw3.h>
#include <glm\glm.hpp>
#include <vector>
#include "Object.h"
class OpenGLController
{
@@ -50,6 +51,7 @@ private:
std::vector<GLfloat> vfVertices;
std::vector<GLfloat> vfUV;
std::uint32_t ui32MeshSize;
std::vector<Modl*> vModels;
// transformation ===============
//values