worked on 3D viz

scaling, moving by finger
some fixes / improvement
This commit is contained in:
k-a-z-u
2018-02-06 17:35:10 +01:00
parent 076c0e9157
commit bce771d6d6
28 changed files with 547 additions and 155 deletions

View File

@@ -0,0 +1,72 @@
#ifndef FLOORPLANRENDERER_H
#define FLOORPLANRENDERER_H
#include <unordered_set>
#include <Indoor/navMesh/NavMesh.h>
#include <Indoor/navMesh/NavMeshTriangle.h>
#include <Indoor/navMesh/NavMeshType.h>
#include <QPainter>
#include <QOpenGLWidget>
#include "../misc/Renderable3D.h"
#include "../misc/Shader.h"
#include "../misc/TriangleData.h"
#include <Indoor/wifi/estimate/ray3/ModelFactory.h>
#include "RenderTriangle.h"
class FloorplanRenderer {
public:
/** ctor */
FloorplanRenderer() {
;
}
/** render the given grid using GL commands */
void renderSolid(const RenderSettings& rs, const RenderTriangle& rt) {
rs.shader->bind();
rs.shader->setModelMatrix(QMatrix4x4());
rs.shader->setVertices(rt.getVertices().data());
rs.shader->setNormals(rt.getNormals().data());
rs.shader->setVertexColor(rt.getRGBA().data());
glDrawArrays(GL_TRIANGLES, 0, rt.getVertices().size()/3);
rs.shader->unsetVertices();
rs.shader->unsetNormals();
rs.shader->unsetVertexColor();
rs.shader->release();
}
/** render the given grid using GL commands */
void renderTransp(const RenderSettings& rs, const RenderTriangle& rt) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
rs.shader->bind();
rs.shader->setModelMatrix(QMatrix4x4());
rs.shader->setVertices(rt.getVertices().data());
rs.shader->setNormals(rt.getNormals().data());
rs.shader->setVertexColor(rt.getRGBA().data());
glDrawArrays(GL_TRIANGLES, 0, rt.getVertices().size()/3);
rs.shader->unsetVertices();
rs.shader->unsetNormals();
rs.shader->unsetVertexColor();
rs.shader->release();
glDisable(GL_BLEND);
}
};
#endif // FLOORPLANRENDERER_H