well, basically, can it be done ? I spent a good part of the day finding a method to remove duplicate vertices faster than
Code: Select all
->getMeshManipulator()->createMeshWelded
The problem is that for a terrain kind of mesh basically the method
Code: Select all
for (u32 i=0; i<currentIndices->size(); i+=3)
{
u32 index1 = currentIndices->operator[](i+0);
u32 index2 = currentIndices->operator[](i+1);
u32 index3 = currentIndices->operator[](i+2);
const core::vector3df normal = core::plane3d<f32>(currentVertices->operator[](index1).Pos,
currentVertices->operator[](index2).Pos,
currentVertices->operator[](index3).Pos).Normal;
currentVertices->operator[](index1).Normal += normal;
currentVertices->operator[](index2).Normal += normal;
currentVertices->operator[](index3).Normal += normal;
}
If you turn on debug data normals you can see 2 normals sticking out of each vertice... Maybe I'm just little overworked and tired, but I dont see the light here...
Thx in advance...