diff --git a/examples/Basic/OpenGLWidget.cpp b/examples/Basic/OpenGLWidget.cpp index ad0facfa..e9998220 100644 --- a/examples/Basic/OpenGLWidget.cpp +++ b/examples/Basic/OpenGLWidget.cpp @@ -19,19 +19,23 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh), vecVertices.data(), GL_STATIC_DRAW); //and GL_ELEMENT_ARRAY_BUFFER will contain the indices - glGenBuffers(1, &(mMeshData.indexBuffer)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mMeshData.indexBuffer); + glGenBuffers(1, &(meshData.indexBuffer)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshData.indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), vecIndices.data(), GL_STATIC_DRAW); //We need to tell OpenGL how to understand the format of the vertex data @@ -40,7 +44,9 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh mMeshData; QGLShaderProgram shader; diff --git a/examples/Basic/main.cpp b/examples/Basic/main.cpp index 09dc5423..3b04f04c 100644 --- a/examples/Basic/main.cpp +++ b/examples/Basic/main.cpp @@ -78,11 +78,15 @@ int main(int argc, char *argv[]) createSphereInVolume(volData, 30); // Extract the surface for the specified region of the volume. Uncomment the line for the kind of surface extraction you want to see. - auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); + //auto mesh = extractCubicSurface(&volData, volData.getEnclosingRegion()); //auto mesh = extractMarchingCubesSurface(&volData, volData.getEnclosingRegion()); + + auto mesh = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(31, 31, 31))); + auto mesh2 = extractCubicSurface(&volData, PolyVox::Region(Vector3DInt32(32, 32, 32), Vector3DInt32(63, 63, 63))); //Pass the surface to the OpenGL window openGLWidget.setSurfaceMeshToRender(mesh); + openGLWidget.setSurfaceMeshToRender(mesh2); //Run the message pump. return app.exec();