Renamed SurfaceMesh to just Mesh
This commit is contained in:
@ -21,7 +21,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent)
|
||||
{
|
||||
}
|
||||
|
||||
void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh<MarchingCubesVertex<uint8_t> >& surfaceMesh)
|
||||
void OpenGLWidget::setMeshToRender(const PolyVox::Mesh<MarchingCubesVertex<uint8_t> >& surfaceMesh)
|
||||
{
|
||||
//Convienient access to the vertices and indices
|
||||
const vector<uint32_t>& vecIndices = surfaceMesh.getIndices();
|
||||
@ -43,7 +43,7 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh<MarchingCub
|
||||
m_uEndIndex = vecIndices.size();
|
||||
}
|
||||
|
||||
void OpenGLWidget::setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh<MarchingCubesVertex<uint8_t> >& surfaceMesh)
|
||||
void OpenGLWidget::setMeshToRenderLowLOD(const PolyVox::Mesh<MarchingCubesVertex<uint8_t> >& surfaceMesh)
|
||||
{
|
||||
//Convienient access to the vertices and indices
|
||||
const vector<uint32_t>& vecIndices = surfaceMesh.getIndices();
|
||||
|
@ -24,7 +24,7 @@ distribution.
|
||||
#ifndef __BasicExample_OpenGLWidget_H__
|
||||
#define __BasicExample_OpenGLWidget_H__
|
||||
|
||||
#include "PolyVoxCore/SurfaceMesh.h"
|
||||
#include "PolyVoxCore/Mesh.h"
|
||||
|
||||
#include "glew/glew.h"
|
||||
|
||||
@ -41,8 +41,8 @@ public:
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
|
||||
//Convert a SrfaceMesh to OpenGL index/vertex buffers
|
||||
void setSurfaceMeshToRender(const PolyVox::SurfaceMesh<PolyVox::MarchingCubesVertex <uint8_t> >& surfaceMesh);
|
||||
void setSurfaceMeshToRenderLowLOD(const PolyVox::SurfaceMesh<PolyVox::MarchingCubesVertex<uint8_t> >& surfaceMesh);
|
||||
void setMeshToRender(const PolyVox::Mesh<PolyVox::MarchingCubesVertex <uint8_t> >& surfaceMesh);
|
||||
void setMeshToRenderLowLOD(const PolyVox::Mesh<PolyVox::MarchingCubesVertex<uint8_t> >& surfaceMesh);
|
||||
|
||||
protected:
|
||||
//Qt OpenGL functions
|
||||
|
@ -25,7 +25,7 @@ freely, subject to the following restrictions:
|
||||
|
||||
#include "PolyVoxCore/Density.h"
|
||||
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
|
||||
#include "PolyVoxCore/SurfaceMesh.h"
|
||||
#include "PolyVoxCore/Mesh.h"
|
||||
#include "PolyVoxCore/RawVolume.h"
|
||||
#include "PolyVoxCore/SimpleVolume.h"
|
||||
#include "PolyVoxCore/VolumeResampler.h"
|
||||
@ -89,17 +89,17 @@ int main(int argc, char *argv[])
|
||||
VolumeResampler< SimpleVolume<uint8_t>, RawVolume<uint8_t> > volumeResampler(&volData, PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(31, 63, 63)), &volDataLowLOD, volDataLowLOD.getEnclosingRegion());
|
||||
volumeResampler.execute();
|
||||
|
||||
//Extract the surface
|
||||
//Extract the surface
|
||||
auto meshLowLOD = extractMarchingCubesMesh(&volDataLowLOD, volDataLowLOD.getEnclosingRegion());
|
||||
meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f);
|
||||
|
||||
//Extract the surface
|
||||
auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63)));
|
||||
auto meshHighLOD = extractMarchingCubesMesh(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63)));
|
||||
meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0));
|
||||
|
||||
//Pass the surface to the OpenGL window
|
||||
openGLWidget.setSurfaceMeshToRender(meshHighLOD);
|
||||
openGLWidget.setSurfaceMeshToRenderLowLOD(meshLowLOD);
|
||||
openGLWidget.setMeshToRender(meshHighLOD);
|
||||
openGLWidget.setMeshToRenderLowLOD(meshLowLOD);
|
||||
|
||||
//Run the message pump.
|
||||
return app.exec();
|
||||
|
Reference in New Issue
Block a user