Okay it's me again (I spoke too fast
)
I still have one question, it's not directly about the library (or maybe it is), but I was wondering if you could help me.
Here's what I want to do :
I would like to have a three-dimensional array that contains the terrain. By that, I mean it would contain numbers that represent cubes (0=nothing, 1=dirt, 2=sand etc...)
But that's not my problem, my real problem is how to use it when I must define textures.
Here's the code that draws the ManualObject mesh :
Code:
for(int index = beginIndex; index < endIndex; ++index) {
const PolyVox::PositionMaterialNormal& vertex = vecVertices[vecIndices[index]];
const PolyVox::Vector3DFloat& v3dVertexPos = vertex.getPosition();
const PolyVox::Vector3DFloat& v3dVertexNormal = vertex.getNormal();
const PolyVox::Vector3DFloat v3dFinalVertexPos = v3dVertexPos + static_cast<PolyVox::Vector3DFloat>(mesh.m_Region.getLowerCorner());
ogreMesh->position(v3dFinalVertexPos.getX(), v3dFinalVertexPos.getY(), v3dFinalVertexPos.getZ());
ogreMesh->normal(v3dVertexNormal.getX(), v3dVertexNormal.getY(), v3dVertexNormal.getZ());
}
Now, this
for is listing every Vertex I have to draw but I would like to know, for each vertex, from what cube they belong (Like if I'm drawing the cube in (0,0,0) or in (4,3,5)), so I could know what texture I have to print on them.
I don't know if you understand what I want to do (my sentences are a bit messy), but I'd be really grateful.
Thanks