Initial work on progressive mesh generation. Currently based on Stan Melax's PolyChop.
This commit is contained in:
@ -6,15 +6,19 @@
|
||||
using namespace PolyVox;
|
||||
using namespace std;
|
||||
|
||||
void renderRegionImmediateMode(PolyVox::IndexedSurfacePatch& isp)
|
||||
void renderRegionImmediateMode(PolyVox::IndexedSurfacePatch& isp, unsigned int uLodLevel)
|
||||
{
|
||||
const vector<SurfaceVertex>& vecVertices = isp.getVertices();
|
||||
const vector<PolyVox::uint32_t>& vecIndices = isp.getIndices();
|
||||
|
||||
int beginIndex = isp.m_vecLodRecords[uLodLevel].beginIndex;
|
||||
int endIndex = isp.m_vecLodRecords[uLodLevel].endIndex;
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
for(vector<PolyVox::uint32_t>::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex)
|
||||
//for(vector<PolyVox::uint32_t>::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex)
|
||||
for(int index = beginIndex; index < endIndex; ++index)
|
||||
{
|
||||
const SurfaceVertex& vertex = vecVertices[*iterIndex];
|
||||
const SurfaceVertex& vertex = vecVertices[vecIndices[index]];
|
||||
const Vector3DFloat& v3dVertexPos = vertex.getPosition();
|
||||
//const Vector3DFloat v3dRegionOffset(uRegionX * g_uRegionSideLength, uRegionY * g_uRegionSideLength, uRegionZ * g_uRegionSideLength);
|
||||
const Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast<Vector3DFloat>(isp.m_Region.getLowerCorner());
|
||||
|
Reference in New Issue
Block a user