From 7206c35fd5e90a84a9ae1c1b8740b6c1878e1eb0 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Thu, 23 Apr 2015 20:27:45 +0200 Subject: [PATCH] tmp fix for missing BBox --- Weave/Graphix/Model/BBox.cpp | 8 +++++--- Weave/Graphix/Model/IMetaMesh.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Weave/Graphix/Model/BBox.cpp b/Weave/Graphix/Model/BBox.cpp index 4f28d32..1f44341 100644 --- a/Weave/Graphix/Model/BBox.cpp +++ b/Weave/Graphix/Model/BBox.cpp @@ -14,6 +14,7 @@ BBox::BBox() //import("skybox.dae", numvertices, numfaces, vertex, uvs, normals, index, 0); genBuffer(vertexBuffer, numvertices * 3 * sizeof(float), (void*)vertex); + genBuffer(indexBuffer, 4 * sizeof(float), (void*)indexL1); } @@ -24,8 +25,9 @@ BBox::~BBox() void BBox::drawModel() const { - glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_INT, indexL1); - glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_INT, indexL2); - glDrawElements(GL_LINES, 8, GL_UNSIGNED_INT, indexS1); + glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_INT, 0); + //glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_INT, indexL1); + //glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_INT, indexL2); + //glDrawElements(GL_LINES, 8, GL_UNSIGNED_INT, indexS1); glBindVertexArray(0); } \ No newline at end of file diff --git a/Weave/Graphix/Model/IMetaMesh.cpp b/Weave/Graphix/Model/IMetaMesh.cpp index 4ec9792..f6f7902 100644 --- a/Weave/Graphix/Model/IMetaMesh.cpp +++ b/Weave/Graphix/Model/IMetaMesh.cpp @@ -13,7 +13,7 @@ IMetaMesh::IMetaMesh(const string& _modelpath) { Assimp::Importer importer; - const aiScene* scene = importer.ReadFile("../models/" + _modelpath, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType | aiProcess_PreTransformVertices); + const aiScene* scene = importer.ReadFile("../models/" + _modelpath, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType | aiProcess_PreTransformVertices); // if (!scene) { Message::error("The file " + _modelpath + " couldn't be read.\n" + importer.GetErrorString()); -- 2.47.3